The issue is due to the _configure_database.php initiating the global $databaseConfig. And that prevents from loading the other required configs like the username, param, and the more importantly the type.
Woud be fixed if all the configs are read in. in the _configure_database.php
use SilverStripe\Core\Environment;
use SilverStripe\SQLite\SQLite3Database;
global $databaseConfig;
if (!isset($databaseConfig)) {
global $databaseConfig;
$databaseConfig = [
"type" => Environment::getEnv('SS_DATABASE_CLASS') ?: 'MySQLDatabase',
"server" => Environment::getEnv('SS_DATABASE_SERVER') ?: 'localhost',
"username" => Environment::getEnv('SS_DATABASE_USERNAME') ?: null,
"password" => Environment::getEnv('SS_DATABASE_PASSWORD') ?: null,
];
}
// 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);
}
The issue is due to the _configure_database.php initiating the
global $databaseConfig
. And that prevents from loading the other required configs like the username, param, and the more importantly thetype
.Woud be fixed if all the configs are read in. in the
_configure_database.php