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'] ?? [];
|
||||
|
||||
@@ -5,7 +5,25 @@
|
||||
// → Diese Datei DEFINIERT die Konstanten wie
|
||||
// APP_COOKIE_PREFIX, APP_COOKIE_DOMAIN, APP_ENV etc.
|
||||
// -----------------------------------------------------------
|
||||
require_once __DIR__ . "/config.php";
|
||||
// Try to load primary environment bootstrap.
|
||||
$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';
|
||||
$bootstrapLoaded = false;
|
||||
foreach ($bootstrapCandidates as $bootstrap) {
|
||||
if ($bootstrap && is_file($bootstrap)) {
|
||||
require_once $bootstrap;
|
||||
$bootstrapLoaded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$bootstrapLoaded) {
|
||||
throw new RuntimeException('No environment config found under config/.');
|
||||
}
|
||||
|
||||
$emailtemplateConfigPath = __DIR__ . '/emailtemplate.conf.php';
|
||||
if (is_file($emailtemplateConfigPath)) {
|
||||
|
||||
Reference in New Issue
Block a user