X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBViaLBRepo.php;h=a59ca34a048524e27a3b5e78a1cfdbd336f2d7e7;hb=e917cafe44afc92ef2cca1e2410bc083075acdb2;hp=8153ffb470fa439f4ea6e58e9c2d26d47dd14635;hpb=b9340187c848d75c78953ef8628720d34a81d185;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index 8153ffb470..a59ca34a04 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -37,10 +37,10 @@ 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' ]; /** * @param array|null $info @@ -53,17 +53,27 @@ class ForeignDBViaLBRepo extends LocalRepo { } /** - * @return DatabaseBase + * @return IDatabase */ function getMasterDB() { - return wfGetDB( DB_MASTER, array(), $this->wiki ); + return wfGetDB( DB_MASTER, [], $this->wiki ); } /** - * @return DatabaseBase + * @return IDatabase */ function getSlaveDB() { - return wfGetDB( DB_SLAVE, array(), $this->wiki ); + return wfGetDB( DB_SLAVE, [], $this->wiki ); + } + + /** + * @return Closure + */ + protected function getDBFactory() { + $wiki = $this->wiki; + return function( $index ) use ( $wiki ) { + return wfGetDB( $index, [], $wiki ); + }; } function hasSharedCache() {