From 44958ebd1194478a0bf0c3738aa73311fec9359c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 7 Oct 2015 22:36:49 -0700 Subject: [PATCH] Make ForeignDBRepo::getDBFactory() actually work on 5.3 Change-Id: Id790ccb1728a6a163f2e2149dd56ec1b14fc33af --- includes/filerepo/ForeignDBRepo.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) 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 ); }; } -- 2.20.1