Deprecating: Consolidating `progressive` & `constructive` buttons
[lhc/web/wiklou.git] / maintenance / populateContentModel.php
index 3f5d6b6..c158cb4 100644 (file)
@@ -30,14 +30,14 @@ require_once __DIR__ . '/Maintenance.php';
 class PopulateContentModel extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = 'Populate the various content_* fields';
+               $this->addDescription( 'Populate the various content_* fields' );
                $this->addOption( 'ns', 'Namespace to run in, or "all" for all namespaces', true, true );
                $this->addOption( 'table', 'Table to run in', true, true );
                $this->setBatchSize( 100 );
        }
 
        public function execute() {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $ns = $this->getOption( 'ns' );
                if ( !ctype_digit( $ns ) && $ns !== 'all' ) {
                        $this->error( 'Invalid namespace', 1 );
@@ -178,7 +178,7 @@ class PopulateContentModel extends Maintenance {
                                        if ( $dbFormat === $defaultFormat ) {
                                                $toSave[$defaultModel][] = $row->{$key};
                                        } else { // non-default format, just update now
-                                               $this->output( "Updating model to match format for $table $id of $title... ");
+                                               $this->output( "Updating model to match format for $table $id of $title... " );
                                                $dbw->update(
                                                        $table,
                                                        array( $model_column => $defaultModel ),