e0f22b839d384cba0a9701ea18ef6086be9571d8
3 * Quickie hack; patch-ss_images.sql uses variables which don't
10 require_once( "Maintenance.php" );
12 class RefreshImageCount
extends Maintenance
{
13 public function __construct() {
14 parent
::__construct();
15 $this->mDescription
= "Resets ss_image count, forcing slaves to pick it up.";
18 public function execute() {
19 $dbw = wfGetDB( DB_MASTER
);
21 // Load the current value from the master
22 $count = $dbw->selectField( 'site_stats', 'ss_images' );
24 $this->output( wfWikiID() . ": forcing ss_images to $count\n" );
26 // First set to NULL so that it changes on the master
27 $dbw->update( 'site_stats',
28 array( 'ss_images' => null ),
29 array( 'ss_row_id' => 1 ) );
31 // Now this update will be forced to go out
32 $dbw->update( 'site_stats',
33 array( 'ss_images' => $count ),
34 array( 'ss_row_id' => 1 ) );
38 $maintClass = "RefreshImageCount";
39 require_once( DO_MAINTENANCE
);