class TitleCleanup extends TableCleanup {
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to clean up broken, unparseable titles";
+ $this->addDescription( 'Script to clean up broken, unparseable titles' );
}
/**
protected function fileExists( $name ) {
// XXX: Doesn't actually check for file existence, just presence of image record.
// This is reasonable, since cleanupImages.php only iterates over the image table.
- $dbr = $this->getDB( DB_SLAVE );
- $row = $dbr->selectRow( 'image', array( 'img_name' ), array( 'img_name' => $name ), __METHOD__ );
+ $dbr = $this->getDB( DB_REPLICA );
+ $row = $dbr->selectRow( 'image', [ 'img_name' ], [ 'img_name' => $name ], __METHOD__ );
return $row !== false;
}
protected function moveIllegalPage( $row ) {
$legal = 'A-Za-z0-9_/\\\\-';
$legalized = preg_replace_callback( "!([^$legal])!",
- array( &$this, 'hexChar' ),
+ [ $this, 'hexChar' ],
$row->page_title );
if ( $legalized == '.' ) {
$legalized = '(dot)';
"'$row->page_title') to ($row->page_namespace,'$dest')\n" );
$dbw = $this->getDB( DB_MASTER );
$dbw->update( 'page',
- array( 'page_title' => $dest ),
- array( 'page_id' => $row->page_id ),
+ [ 'page_title' => $dest ],
+ [ 'page_id' => $row->page_id ],
__METHOD__ );
}
}
"'$row->page_title') to ($ns,'$dest')\n" );
$dbw = $this->getDB( DB_MASTER );
$dbw->update( 'page',
- array(
+ [
'page_namespace' => $ns,
'page_title' => $dest
- ),
- array( 'page_id' => $row->page_id ),
+ ],
+ [ 'page_id' => $row->page_id ],
__METHOD__ );
LinkCache::singleton()->clear();
}