Merge "HTMLUserTextField: Enable suggestions for non-OOUI mode"
[lhc/web/wiklou.git] / maintenance / fixDefaultJsonContentPages.php
index 1265891..18334d6 100644 (file)
@@ -32,8 +32,8 @@ require_once __DIR__ . '/Maintenance.php';
 class FixDefaultJsonContentPages extends LoggedUpdateMaintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription =
-                               'Fix instances of JSON pages prior to them being the ContentHandler default';
+               $this->addDescription(
+                       'Fix instances of JSON pages prior to them being the ContentHandler default' );
                $this->setBatchSize( 100 );
        }
 
@@ -47,7 +47,7 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance {
                        return true;
                }
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_SLAVE );
                $namespaces = array(
                        NS_MEDIAWIKI => $dbr->buildLike( $dbr->anyString(), '.json' ),
                        NS_USER => $dbr->buildLike( $dbr->anyString(), '/', $dbr->anyString(), '.json' ),
@@ -80,7 +80,7 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance {
                $this->output( "Processing {$title} ({$row->page_id})...\n" );
                $rev = Revision::newFromTitle( $title );
                $content = $rev->getContent( Revision::RAW );
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                if ( $content instanceof JsonContent ) {
                        if ( $content->isValid() ) {
                                // Yay, actually JSON. We need to just change the