X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBViaLBRepo.php;h=129d55aa2ab56a7acc0a4037c422ec2c0e27d977;hb=4ab8b9cd32d384a626960b8ca4d8547a6fd5dbfa;hp=f8b1ed9f7964159235f3dfa6aea461b9233c2637;hpb=ba67060734ecfa835f54c83540c0c136db1690d7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index f8b1ed9f79..129d55aa2a 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -42,6 +42,9 @@ class ForeignDBViaLBRepo extends LocalRepo { /** @var array */ protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ]; + /** @var bool */ + protected $hasSharedCache; + /** * @param array|null $info */ @@ -56,23 +59,22 @@ class ForeignDBViaLBRepo extends LocalRepo { * @return IDatabase */ function getMasterDB() { - return wfGetDB( DB_MASTER, [], $this->wiki ); + return wfGetLB( $this->wiki )->getConnectionRef( DB_MASTER, [], $this->wiki ); } /** * @return IDatabase */ function getSlaveDB() { - return wfGetDB( DB_REPLICA, [], $this->wiki ); + return wfGetLB( $this->wiki )->getConnectionRef( DB_REPLICA, [], $this->wiki ); } /** * @return Closure */ protected function getDBFactory() { - $wiki = $this->wiki; - return function( $index ) use ( $wiki ) { - return wfGetDB( $index, [], $wiki ); + return function( $index ) { + return wfGetLB( $this->wiki )->getConnectionRef( $index, [], $this->wiki ); }; }