rebuild to module
This commit is contained in:
30
config/base_db.php
Normal file
30
config/base_db.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Base database for Nexus core (users, settings, modules).
|
||||
* This uses the environment-specific config in /config/{env}/db_settings_basic.php.
|
||||
*/
|
||||
|
||||
$env = getenv('APP_ENV');
|
||||
if (!$env && defined('APP_ENV')) {
|
||||
$env = APP_ENV;
|
||||
}
|
||||
if (!$env) {
|
||||
$env = 'prod';
|
||||
}
|
||||
|
||||
$env = strtolower((string)$env);
|
||||
$candidates = [
|
||||
__DIR__ . '/' . $env . '/db_settings_basic.php',
|
||||
__DIR__ . '/staging/db_settings_basic.php',
|
||||
__DIR__ . '/prod/db_settings_basic.php',
|
||||
];
|
||||
|
||||
foreach ($candidates as $path) {
|
||||
if (file_exists($path)) {
|
||||
return require $path;
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException('Missing base DB config: expected config/{env}/db_settings_basic.php');
|
||||
Reference in New Issue
Block a user