X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FnamespaceDupes.php;h=b59f4a960fcf3e7cd6ae85a5b8ce63c3f9f50072;hb=5083e810ebd5303bef41c2b00cafe655f9ee13eb;hp=28176a55dc4bbdc427064d1ff0d97c486d0ef3ee;hpb=764dc6ae51b301e25b0361d113990a01a1a44fa5;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 28176a55dc..b59f4a960f 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -47,7 +47,7 @@ class NamespaceConflictChecker extends Maintenance { 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" ); @@ -67,7 +67,7 @@ class NamespaceConflictChecker extends Maintenance { } public function execute() { - $this->db = wfGetDB( DB_MASTER ); + $this->db = $this->getDB( DB_MASTER ); $options = array( 'fix' => $this->hasOption( 'fix' ), @@ -570,6 +570,7 @@ class NamespaceConflictChecker extends Maintenance { * * @param integer $id The page_id * @param Title $newTitle The new title + * @return bool */ private function mergePage( $row, Title $newTitle ) { $id = $row->page_id; @@ -583,7 +584,7 @@ class NamespaceConflictChecker extends Maintenance { $wikiPage->loadPageData( 'fromdbmaster' ); $destId = $newTitle->getArticleId(); - $this->db->begin( __METHOD__ ); + $this->beginTransaction( $this->db, __METHOD__ ); $this->db->update( 'revision', // SET array( 'rev_page' => $destId ), @@ -604,7 +605,7 @@ class NamespaceConflictChecker extends Maintenance { */ $update = new LinksDeletionUpdate( $wikiPage ); $update->doUpdate(); - $this->db->commit( __METHOD__ ); + $this->commitTransaction( $this->db, __METHOD__ ); return true; }