Merge "Allow easy suppression of multiple deleted revs"
[lhc/web/wiklou.git] / maintenance / orphans.php
index 7e27107..24ead60 100644 (file)
@@ -39,10 +39,11 @@ require_once __DIR__ . '/Maintenance.php';
 class Orphans extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Look for 'orphan' revisions hooked to pages which don't exist\n" .
+               $this->addDescription( "Look for 'orphan' revisions hooked to pages which don't exist\n" .
                        "and 'childless' pages with no revisions\n" .
                        "Then, kill the poor widows and orphans\n" .
-                       "Man this is depressing";
+                       "Man this is depressing"
+               );
                $this->addOption( 'fix', 'Actually fix broken entries' );
        }
 
@@ -71,7 +72,7 @@ class Orphans extends Maintenance {
         * @param bool $fix Whether to fix broken revisions when found
         */
        private function checkOrphans( $fix ) {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $page = $dbw->tableName( 'page' );
                $revision = $dbw->tableName( 'revision' );
 
@@ -129,7 +130,7 @@ class Orphans extends Maintenance {
         *       but valid revisions do exist)
         */
        private function checkWidows( $fix ) {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $page = $dbw->tableName( 'page' );
                $revision = $dbw->tableName( 'revision' );
 
@@ -175,7 +176,7 @@ class Orphans extends Maintenance {
         * @param bool $fix Whether to fix broken entries
         */
        private function checkSeparation( $fix ) {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $page = $dbw->tableName( 'page' );
                $revision = $dbw->tableName( 'revision' );