From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/filerepo/ForeignDBRepo.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'includes/filerepo/ForeignDBRepo.php') diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index 6e9e6add..dfdb3753 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -76,17 +76,8 @@ class ForeignDBRepo extends LocalRepo { */ function getMasterDB() { if ( !isset( $this->dbConn ) ) { - $this->dbConn = 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, - ) - ); + $func = $this->getDBFactory(); + $this->dbConn = $func( DB_MASTER ); } return $this->dbConn; @@ -99,6 +90,25 @@ class ForeignDBRepo extends LocalRepo { return $this->getMasterDB(); } + /** + * @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, + ) + ); + }; + } + /** * @return bool */ -- cgit v1.2.3-54-g00ecf