X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBRepo.php;h=001800f3ba12e48c10831a33711242292d7381fb;hb=9ba3fca2d8adc56787c8efc32c41424cb212e387;hp=f3a560b4db2b231cb40ee68e15117c038c0df898;hpb=868aeed43150b5d0b387d46a2f441d317244908c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index f3a560b4db..001800f3ba 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -53,8 +53,8 @@ class ForeignDBRepo extends LocalRepo { # Other stuff protected $dbConn; - protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' ); - protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' ); + protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ]; + protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ]; /** * @param array|null $info @@ -94,18 +94,19 @@ class ForeignDBRepo extends LocalRepo { * @return Closure */ protected function getDBFactory() { - return function( $index ) { - return DatabaseBase::factory( $this->dbType, - array( - 'host' => $this->dbServer, - 'user' => $this->dbUser, - 'password' => $this->dbPassword, - 'dbname' => $this->dbName, - 'flags' => $this->dbFlags, - 'tablePrefix' => $this->tablePrefix, - 'foreign' => true, - ) - ); + $type = $this->dbType; + $params = [ + 'host' => $this->dbServer, + 'user' => $this->dbUser, + 'password' => $this->dbPassword, + 'dbname' => $this->dbName, + 'flags' => $this->dbFlags, + 'tablePrefix' => $this->tablePrefix, + 'foreign' => true, + ]; + + return function ( $index ) use ( $type, $params ) { + return DatabaseBase::factory( $type, $params ); }; }