* This function resets $this->lb and closes all connections on it.
*
* @throws MWException
+ * @suppress PhanTypeObjectUnsetDeclaredProperty
*/
function rotateDb() {
// Cleaning up old connections
}
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() . ")" );
function openSpawn() {
global $IP;
+ $wiki = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() );
if ( count( $this->php ) == 2 ) {
$mwscriptpath = $this->php[1];
} else {
$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" ],