X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBViaLBRepo.php;h=ad6ec472f4333a1cda00a9f51f3b1413161b21bb;hb=a7f52bb26afcb71e74008f083cf63af9c34b1644;hp=302b194a2cda98403568248f778cd08e02e39ecb;hpb=8c96aec32cffaab96b2bd9dca206a99a13640545;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index 302b194a2c..ad6ec472f4 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -23,7 +23,7 @@ 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 @@ -34,12 +34,6 @@ class ForeignDBViaLBRepo extends LocalRepo { /** @var string */ protected $wiki; - /** @var string */ - protected $dbName; - - /** @var string */ - protected $tablePrefix; - /** @var array */ protected $fileFactory = [ ForeignDBFile::class, 'newFromTitle' ]; @@ -55,7 +49,6 @@ class ForeignDBViaLBRepo extends LocalRepo { function __construct( $info ) { parent::__construct( $info ); $this->wiki = $info['wiki']; - list( $this->dbName, $this->tablePrefix ) = wfSplitWikiID( $this->wiki ); $this->hasSharedCache = $info['hasSharedCache']; } @@ -83,10 +76,11 @@ class ForeignDBViaLBRepo extends LocalRepo { } /** - * @return LoadBalancer + * @return ILoadBalancer */ protected function getDBLoadBalancer() { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + return $lbFactory->getMainLB( $this->wiki ); }