2013-04-03 17:49:59 +13:00
|
|
|
<?php
|
|
|
|
|
2017-11-21 17:35:20 +13:00
|
|
|
// Called from DatabaseAdapterRegistry::autoconfigure($config)
|
|
|
|
use SilverStripe\Core\Environment;
|
|
|
|
use SilverStripe\SQLite\SQLite3Database;
|
2013-04-03 17:49:59 +13:00
|
|
|
|
2017-11-21 17:35:20 +13:00
|
|
|
if (!isset($databaseConfig)) {
|
|
|
|
global $databaseConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get path
|
|
|
|
$path = Environment::getEnv(SQLite3Database::ENV_PATH);
|
|
|
|
if ($path) {
|
|
|
|
$databaseConfig['path'] = $path;
|
|
|
|
} elseif (defined(SQLite3Database::ENV_PATH)) {
|
|
|
|
$databaseConfig['path'] = constant(SQLite3Database::ENV_PATH);
|
|
|
|
}
|
2013-04-03 17:49:59 +13:00
|
|
|
|
2017-11-21 17:35:20 +13:00
|
|
|
// Get key
|
|
|
|
$key = Environment::getEnv(SQLite3Database::ENV_KEY);
|
|
|
|
if ($key) {
|
|
|
|
$databaseConfig['key'] = $key;
|
|
|
|
} elseif (defined(SQLite3Database::ENV_KEY)) {
|
|
|
|
$databaseConfig['key'] = constant(SQLite3Database::ENV_KEY);
|
2013-04-03 17:49:59 +13:00
|
|
|
}
|