wiki.techinc.nl/maintenance/refreshImageCount.php
Nick Jenkins f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00

25 lines
596 B
PHP

<?php
// Quickie hack; patch-ss_images.sql uses variables which don't
// replicate properly.
require_once( "commandLine.inc" );
$dbw = wfGetDB( DB_MASTER );
// Load the current value from the master
$count = $dbw->selectField( 'site_stats', 'ss_images' );
echo wfWikiID().": forcing ss_images to $count\n";
// First set to NULL so that it changes on the master
$dbw->update( 'site_stats',
array( 'ss_images' => null ),
array( 'ss_row_id' => 1 ) );
// Now this update will be forced to go out
$dbw->update( 'site_stats',
array( 'ss_images' => $count ),
array( 'ss_row_id' => 1 ) );
?>