dbDomain = $info['wiki']; $this->hasAccessibleSharedCache = $info['hasSharedCache']; } public function getPrimaryDB() { return $this->getDBLoadBalancer()->getConnectionRef( DB_PRIMARY, [], $this->dbDomain ); } public function getMasterDB() { wfDeprecated( __METHOD__, '1.37' ); return $this->getPrimaryDB(); } public function getReplicaDB() { return $this->getDBLoadBalancer()->getConnectionRef( DB_REPLICA, [], $this->dbDomain ); } /** * @return Closure */ protected function getDBFactory() { return function ( $index ) { return $this->getDBLoadBalancer()->getConnectionRef( $index, [], $this->dbDomain ); }; } /** * @return ILoadBalancer */ protected function getDBLoadBalancer() { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); return $lbFactory->getMainLB( $this->dbDomain ); } protected function assertWritableRepo() { throw new MWException( static::class . ': write operations are not supported.' ); } public function getInfo() { return FileRepo::getInfo(); } }