* @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() );
# 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 =
<<<EOT