Remove SessionManager, temporarily
[lhc/web/wiklou.git] / maintenance / namespaceDupes.php
index 184cba8..b59f4a9 100644 (file)
@@ -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' ),
@@ -390,7 +390,8 @@ class NamespaceConflictChecker extends Maintenance {
                                                $titleField => $row->$titleField,
                                                $fromField => $row->$fromField
                                        ),
-                                       __METHOD__
+                                       __METHOD__,
+                                       array( 'IGNORE' )
                                );
                                $this->output( "$table $logTitle -> " .
                                        $destTitle->getPrefixedDBkey() . "\n" );
@@ -569,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;
@@ -582,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 ),
@@ -603,7 +605,7 @@ class NamespaceConflictChecker extends Maintenance {
                 */
                $update = new LinksDeletionUpdate( $wikiPage );
                $update->doUpdate();
-               $this->db->commit( __METHOD__ );
+               $this->commitTransaction( $this->db, __METHOD__ );
 
                return true;
        }