rebuild to module

This commit is contained in:
2026-03-03 02:13:17 +01:00
parent ffb52c6789
commit e61f9fb889
23 changed files with 7618 additions and 73 deletions

30
config/base_db.php Normal file
View 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');