class PopulateRevisionLength extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populates the rev_len and ar_len fields";
+ $this->addDescription( 'Populates the rev_len and ar_len fields' );
$this->setBatchSize( 200 );
}
$res = $db->select(
$table,
$fields,
- array(
+ [
"$idCol >= $blockStart",
"$idCol <= $blockEnd",
"{$prefix}_len IS NULL"
- ),
+ ],
__METHOD__
);
- $db->begin( __METHOD__ );
+ $this->beginTransaction( $db, __METHOD__ );
# Go through and update rev_len from these rows.
foreach ( $res as $row ) {
if ( $this->upgradeRow( $row, $table, $idCol, $prefix ) ) {
$count++;
}
}
- $db->commit( __METHOD__ );
+ $this->commitTransaction( $db, __METHOD__ );
$blockStart += $this->mBatchSize;
$blockEnd += $this->mBatchSize;
# Update the row...
$db->update( $table,
- array( "{$prefix}_len" => $content->getSize() ),
- array( $idCol => $row->$idCol ),
+ [ "{$prefix}_len" => $content->getSize() ],
+ [ $idCol => $row->$idCol ],
__METHOD__
);