mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
26 lines
671 B
PHP
26 lines
671 B
PHP
<?php
|
|
|
|
// Called from DatabaseAdapterRegistry::autoconfigure($config)
|
|
use SilverStripe\Core\Environment;
|
|
use SilverStripe\SQLite\SQLite3Database;
|
|
|
|
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);
|
|
}
|
|
|
|
// Get key
|
|
$key = Environment::getEnv(SQLite3Database::ENV_KEY);
|
|
if ($key) {
|
|
$databaseConfig['key'] = $key;
|
|
} elseif (defined(SQLite3Database::ENV_KEY)) {
|
|
$databaseConfig['key'] = constant(SQLite3Database::ENV_KEY);
|
|
}
|