use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\IDatabase;
-use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\ILoadBalancer;
/**
* A foreign repository with a MediaWiki database accessible via the configured LBFactory
/** @var string */
protected $wiki;
- /** @var string */
- protected $dbName;
-
- /** @var string */
- protected $tablePrefix;
-
/** @var array */
protected $fileFactory = [ ForeignDBFile::class, 'newFromTitle' ];
function __construct( $info ) {
parent::__construct( $info );
$this->wiki = $info['wiki'];
- list( $this->dbName, $this->tablePrefix ) = wfSplitWikiID( $this->wiki );
$this->hasSharedCache = $info['hasSharedCache'];
}
}
/**
- * @return LoadBalancer
+ * @return ILoadBalancer
*/
protected function getDBLoadBalancer() {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+
return $lbFactory->getMainLB( $this->wiki );
}