From: Aaron Schulz Date: Thu, 8 Oct 2015 05:36:49 +0000 (-0700) Subject: Make ForeignDBRepo::getDBFactory() actually work on 5.3 X-Git-Tag: 1.31.0-rc.0~9485^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=44958ebd1194478a0bf0c3738aa73311fec9359c;p=lhc%2Fweb%2Fwiklou.git Make ForeignDBRepo::getDBFactory() actually work on 5.3 Change-Id: Id790ccb1728a6a163f2e2149dd56ec1b14fc33af --- diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index f3a560b4db..283576a29e 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -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 = array( + '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 ); }; }