setBatchSize( 500 ); } public function execute() { global $wgEchoCluster; $reader = new BatchRowIterator( MWEchoDbFactory::getDB( DB_SLAVE ), $this->table, $this->idField, $this->mBatchSize ); $reader->addConditions( array( "event_page_title IS NOT NULL", "event_page_id" => null, ) ); $updater = new BatchRowUpdate( $reader, new BatchRowWriter( MWEchoDbFactory::getDB( DB_MASTER ), $this->table, $wgEchoCluster ), new EchoSuppressionRowUpdateGenerator ); $updater->setOutput( array( $this, '__internalOutput' ) ); $updater->execute(); } /** * Internal use only. parent::output() is a protected method, only way to access it from * a callback in php5.3 is to make a public function. In 5.4 can replace with a Closure. */ public function __internalOutput( $text ) { $this->output( $text ); } } $maintClass = 'UpdateEchoSchemaForSuppression'; // Tells it to run the class require_once ( RUN_MAINTENANCE_IF_MAIN );