Repair 2
All checks were successful
Deploy / deploy-staging (push) Successful in 10s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-07 02:52:14 +02:00
parent 72774c05aa
commit a408765e76
5 changed files with 396 additions and 88 deletions

View File

@@ -3,12 +3,22 @@ declare(strict_types=1);
/**
* Base database for Nexus core (users, settings, modules).
* Sync copies the correct file into /config.
* Prefer the deployed root config, but fall back to checked-in env defaults.
*/
$path = __DIR__ . '/db_settings_basic.php';
if (!file_exists($path)) {
throw new RuntimeException('Missing base DB config: expected config/db_settings_basic.php');
$candidates = [
__DIR__ . '/db_settings_basic.php',
__DIR__ . '/staging/db_settings_basic.php',
__DIR__ . '/prod/db_settings_basic.php',
];
foreach ($candidates as $path) {
if (is_file($path)) {
return require $path;
}
}
return require $path;
throw new RuntimeException(
'Missing base DB config. Expected one of: '
. implode(', ', array_map(static fn (string $path): string => basename(dirname($path)) . '/' . basename($path), $candidates))
);