Merge "resourceloader: Reduce module_deps write slams after deployments"
[lhc/web/wiklou.git] / maintenance / rebuildImages.php
index b1bb353..521ab54 100644 (file)
@@ -51,14 +51,14 @@ class ImageBuilder extends Maintenance {
                // make sure to update old, but compatible img_metadata fields.
                $wgUpdateCompatibleMetadata = true;
 
-               $this->mDescription = 'Script to update image metadata records';
+               $this->addDescription( 'Script to update image metadata records' );
 
                $this->addOption( 'missing', 'Check for files without associated database record' );
                $this->addOption( 'dry-run', 'Only report, don\'t update the database' );
        }
 
        public function execute() {
-               $this->dbw = wfGetDB( DB_MASTER );
+               $this->dbw = $this->getDB( DB_MASTER );
                $this->dryrun = $this->hasOption( 'dry-run' );
                if ( $this->dryrun ) {
                        $GLOBALS['wgReadOnly'] = 'Dry run mode, image upgrades are suppressed';
@@ -127,7 +127,7 @@ class ImageBuilder extends Maintenance {
                $this->init( $count, $table );
                $this->output( "Processing $table...\n" );
 
-               $result = wfGetDB( DB_SLAVE )->select( $table, '*', array(), __METHOD__ );
+               $result = $this->getDB( DB_SLAVE )->select( $table, '*', array(), __METHOD__ );
 
                foreach ( $result as $row ) {
                        $update = call_user_func( $callback, $row, null );