Merge "Replace wfWiki() usage with WikiMap in some additional places"
[lhc/web/wiklou.git] / maintenance / storage / recompressTracked.php
index f17b00c..6fd53cc 100644 (file)
@@ -69,6 +69,7 @@ class RecompressTracked {
        public $replicaId = false;
        public $noCount = false;
        public $debugLog, $infoLog, $criticalLog;
+       /** @var ExternalStoreDB */
        public $store;
 
        private static $optionsWithArgs = [
@@ -109,7 +110,8 @@ class RecompressTracked {
                foreach ( $options as $name => $value ) {
                        $this->$name = $value;
                }
-               $this->store = new ExternalStoreDB;
+               $esFactory = MediaWikiServices::getInstance()->getExternalStoreFactory();
+               $this->store = $esFactory->getStore( 'DB' );
                if ( !$this->isChild ) {
                        $GLOBALS['wgDebugLogPrefix'] = "RCT M: ";
                } elseif ( $this->replicaId !== false ) {
@@ -146,7 +148,7 @@ class RecompressTracked {
                if ( $this->replicaId !== false ) {
                        $header .= "({$this->replicaId})";
                }
-               $header .= ' ' . wfWikiID();
+               $header .= ' ' . WikiMap::getCurrentWikiDbDomain()->getId();
                LegacyLogger::emit( sprintf( "%-50s %s\n", $header, $msg ), $file );
        }
 
@@ -216,6 +218,8 @@ class RecompressTracked {
         * writing are all slow.
         */
        function startReplicaProcs() {
+               $wiki = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() );
+
                $cmd = 'php ' . Shell::escape( __FILE__ );
                foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
                        if ( $cmdOption == 'replica-id' ) {
@@ -227,7 +231,7 @@ class RecompressTracked {
                        }
                }
                $cmd .= ' --child' .
-                       ' --wiki ' . Shell::escape( wfWikiID() ) .
+                       ' --wiki ' . Shell::escape( $wiki ) .
                        ' ' . Shell::escape( ...$this->destClusters );
 
                $this->replicaPipes = $this->replicaProcs = [];