public function __construct() {
parent::__construct();
- $this->mDescription = "";
+ $this->addDescription( 'Find and fix pages affected by namespace addition/removal' );
$this->addOption( 'fix', 'Attempt to automatically fix errors' );
$this->addOption( 'merge', "Instead of renaming conflicts, do a history merge with " .
"the correct title" );
}
public function execute() {
- $this->db = wfGetDB( DB_MASTER );
+ $this->db = $this->getDB( DB_MASTER );
$options = array(
'fix' => $this->hasOption( 'fix' ),
$titleField => $row->$titleField,
$fromField => $row->$fromField
),
- __METHOD__
+ __METHOD__,
+ array( 'IGNORE' )
);
$this->output( "$table $logTitle -> " .
$destTitle->getPrefixedDBkey() . "\n" );
*
* @param integer $id The page_id
* @param Title $newTitle The new title
+ * @return bool
*/
private function mergePage( $row, Title $newTitle ) {
$id = $row->page_id;
$wikiPage->loadPageData( 'fromdbmaster' );
$destId = $newTitle->getArticleId();
- $this->db->begin( __METHOD__ );
+ $this->beginTransaction( $this->db, __METHOD__ );
$this->db->update( 'revision',
// SET
array( 'rev_page' => $destId ),
*/
$update = new LinksDeletionUpdate( $wikiPage );
$update->doUpdate();
- $this->db->commit( __METHOD__ );
+ $this->commitTransaction( $this->db, __METHOD__ );
return true;
}