moved transstat.php to maintenance/language/
[lhc/web/wiklou.git] / maintenance / refreshImageCount.php
index 797cedd..88ac3c5 100644 (file)
@@ -6,11 +6,20 @@
 require_once( "commandLine.inc" );
 
 $dbw =& wfGetDB( DB_MASTER );
-$count = $dbw->selectField( 'image', 'COUNT(*)' );
 
-echo "$wgDBname: setting ss_images to $count\n";
+// 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 ) );
 
-?>
\ No newline at end of file
+?>