From: Marius Hoch Date: Mon, 19 Sep 2016 18:11:33 +0000 (+0200) Subject: Fix SqliteInstaller DatabaseSqlite creation X-Git-Tag: 1.31.0-rc.0~5478^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=0cd59925f5542cf584b69afc396e64b9899690a5;p=lhc%2Fweb%2Fwiklou.git Fix SqliteInstaller DatabaseSqlite creation Follow-up to 47e816c69c197fec86c344256d81d7c8f781b880 Change-Id: I1612b0a187ea1df272bdd304ffb2bafbc006b2e4 --- diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index d59c16294d..6024331494 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -179,16 +179,12 @@ class SqliteInstaller extends DatabaseInstaller { * @return Status */ public function openConnection() { - global $wgSQLiteDataDir; - $status = Status::newGood(); $dir = $this->getVar( 'wgSQLiteDataDir' ); $dbName = $this->getVar( 'wgDBname' ); try { # @todo FIXME: Need more sensible constructor parameters, e.g. single associative array - # Setting globals kind of sucks - $wgSQLiteDataDir = $dir; - $db = DatabaseBase::factory( 'sqlite', [ 'dbname' => $dbName ] ); + $db = DatabaseBase::factory( 'sqlite', [ 'dbname' => $dbName, 'dbDirectory' => $dir ] ); $status->value = $db; } catch ( DBConnectionError $e ) { $status->fatal( 'config-sqlite-connection-error', $e->getMessage() ); @@ -243,10 +239,7 @@ class SqliteInstaller extends DatabaseInstaller { # Create the global cache DB try { - global $wgSQLiteDataDir; - # @todo FIXME: setting globals kind of sucks - $wgSQLiteDataDir = $dir; - $conn = DatabaseBase::factory( 'sqlite', [ 'dbname' => "wikicache" ] ); + $conn = DatabaseBase::factory( 'sqlite', [ 'dbname' => 'wikicache', 'dbDirectory' => $dir ] ); # @todo: don't duplicate objectcache definition, though it's very simple $sql = <<