Files
nexus/config/base_db.php
Lars Gebhardt-Kusche a408765e76
All checks were successful
Deploy / deploy-staging (push) Successful in 10s
Deploy / deploy-production (push) Has been skipped
Repair 2
2026-06-07 02:52:14 +02:00

25 lines
639 B
PHP

<?php
declare(strict_types=1);
/**
* Base database for Nexus core (users, settings, modules).
* Prefer the deployed root config, but fall back to checked-in env defaults.
*/
$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;
}
}
throw new RuntimeException(
'Missing base DB config. Expected one of: '
. implode(', ', array_map(static fn (string $path): string => basename(dirname($path)) . '/' . basename($path), $candidates))
);