2013-04-03 06:49:59 +02:00
|
|
|
<?php
|
|
|
|
|
2017-11-21 05:35:20 +01:00
|
|
|
// Called from DatabaseAdapterRegistry::autoconfigure($config)
|
|
|
|
use SilverStripe\Core\Environment;
|
|
|
|
use SilverStripe\SQLite\SQLite3Database;
|
2013-04-03 06:49:59 +02:00
|
|
|
|
2017-11-21 05:35:20 +01: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 06:49:59 +02:00
|
|
|
|
2017-11-21 05:35:20 +01: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 06:49:59 +02:00
|
|
|
}
|