yyxd
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
$bootstrapConfig = __DIR__ . '/config.php';
|
||||
if (is_file($bootstrapConfig)) {
|
||||
require_once $bootstrapConfig;
|
||||
$bootstrapTried = false;
|
||||
$bootstrapLoaded = false;
|
||||
$bootstrapCandidates = [__DIR__ . '/config.php'];
|
||||
$envHint = getenv('APP_ENV') ?: (getenv('APP_ENV_FILE') ?: null);
|
||||
if ($envHint) {
|
||||
$bootstrapCandidates[] = __DIR__ . '/' . $envHint . '/config.php';
|
||||
}
|
||||
$bootstrapCandidates[] = __DIR__ . '/staging/config.php';
|
||||
$bootstrapCandidates[] = __DIR__ . '/prod/config.php';
|
||||
foreach ($bootstrapCandidates as $bootstrapConfig) {
|
||||
if ($bootstrapConfig && is_file($bootstrapConfig)) {
|
||||
$bootstrapTried = true;
|
||||
require_once $bootstrapConfig;
|
||||
$bootstrapLoaded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$bootstrapLoaded) {
|
||||
throw new RuntimeException('No environment config found in config/ or its subdirectories.');
|
||||
}
|
||||
|
||||
$overrides = $GLOBALS['EMAILTEMPLATE_OVERRIDES'] ?? [];
|
||||
|
||||
Reference in New Issue
Block a user