X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBViaLBRepo.php;h=129d55aa2ab56a7acc0a4037c422ec2c0e27d977;hb=4ab8b9cd32d384a626960b8ca4d8547a6fd5dbfa;hp=357f0b92f8e9842d0ffae5c8edf2b408ff46a452;hpb=cb2896f90ebef77c02c9da4067b0e56e37471092;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index 357f0b92f8..129d55aa2a 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -37,10 +37,13 @@ class ForeignDBViaLBRepo extends LocalRepo { protected $tablePrefix; /** @var array */ - protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' ); + protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ]; /** @var array */ - protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' ); + 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, array(), $this->wiki ); + return wfGetLB( $this->wiki )->getConnectionRef( DB_MASTER, [], $this->wiki ); } /** * @return IDatabase */ function getSlaveDB() { - return wfGetDB( DB_SLAVE, array(), $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, array(), $wiki ); + return function( $index ) { + return wfGetLB( $this->wiki )->getConnectionRef( $index, [], $this->wiki ); }; }