public function doDBUpdates() {
$dbw = $this->getDB( DB_MASTER );
if ( !$dbw->tableExists( 'revision' ) ) {
- $this->error( "revision table does not exist", true );
+ $this->fatalError( "revision table does not exist" );
} elseif ( !$dbw->tableExists( 'archive' ) ) {
- $this->error( "archive table does not exist", true );
+ $this->fatalError( "archive table does not exist" );
} elseif ( !$dbw->fieldExists( 'revision', 'rev_len', __METHOD__ ) ) {
$this->output( "rev_len column does not exist\n\n", true );
protected function doLenUpdates( $table, $idCol, $prefix, $queryInfo ) {
$dbr = $this->getDB( DB_REPLICA );
$dbw = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
$start = $dbw->selectField( $table, "MIN($idCol)", false, __METHOD__ );
$end = $dbw->selectField( $table, "MAX($idCol)", false, __METHOD__ );
if ( !$start || !$end ) {
# Do remaining chunks
$blockStart = intval( $start );
- $blockEnd = intval( $start ) + $this->mBatchSize - 1;
+ $blockEnd = intval( $start ) + $batchSize - 1;
$count = 0;
while ( $blockStart <= $end ) {
$this->commitTransaction( $dbw, __METHOD__ );
}
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
wfWaitForSlaves();
}
}
}
-$maintClass = "PopulateRevisionLength";
+$maintClass = PopulateRevisionLength::class;
require_once RUN_MAINTENANCE_IF_MAIN;