Merge "Return null from EditPage::importContentFormData"
[lhc/web/wiklou.git] / maintenance / includes / TextPassDumper.php
index c6738bc..04767fa 100644 (file)
@@ -207,6 +207,7 @@ TEXT
         * This function resets $this->lb and closes all connections on it.
         *
         * @throws MWException
+        * @suppress PhanTypeObjectUnsetDeclaredProperty
         */
        function rotateDb() {
                // Cleaning up old connections
@@ -240,7 +241,7 @@ TEXT
                }
 
                try {
-                       $this->db = $this->lb->getConnection( DB_REPLICA, 'dump' );
+                       $this->db = $this->lb->getMaintenanceConnectionRef( DB_REPLICA, 'dump' );
                } catch ( Exception $e ) {
                        throw new MWException( __METHOD__
                                . " rotating DB failed to obtain new database (" . $e->getMessage() . ")" );
@@ -759,6 +760,7 @@ TEXT
        function openSpawn() {
                global $IP;
 
+               $wiki = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() );
                if ( count( $this->php ) == 2 ) {
                        $mwscriptpath = $this->php[1];
                } else {
@@ -771,14 +773,14 @@ TEXT
                                                $this->php[0],
                                                $mwscriptpath,
                                                "fetchText.php",
-                                               '--wiki', wfWikiID() ] ) );
+                                               '--wiki', $wiki ] ) );
                } else {
                        $cmd = implode( " ",
                                array_map( [ Shell::class, 'escape' ],
                                        [
                                                $this->php[0],
                                                "$IP/maintenance/fetchText.php",
-                                               '--wiki', wfWikiID() ] ) );
+                                               '--wiki', $wiki ] ) );
                }
                $spec = [
                        0 => [ "pipe", "r" ],