debug
This commit is contained in:
@@ -10,6 +10,22 @@ $envHint = getenv('APP_ENV_FILE') ?: (getenv('APP_ENV') ?: null);
|
||||
if ($envHint && !preg_match('/^[A-Za-z0-9_\-]+$/', $envHint)) {
|
||||
$envHint = null;
|
||||
}
|
||||
if ($envHint === null) {
|
||||
$host = '';
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
|
||||
$host = strtolower(trim(explode(',', (string)$_SERVER['HTTP_X_FORWARDED_HOST'])[0]));
|
||||
} elseif (!empty($_SERVER['HTTP_HOST'])) {
|
||||
$host = strtolower((string)$_SERVER['HTTP_HOST']);
|
||||
}
|
||||
if ($host !== '') {
|
||||
$host = preg_replace('/:\\d+$/', '', $host);
|
||||
if ($host === 'staging.emailtemplate.it') {
|
||||
$envHint = 'staging';
|
||||
} elseif (preg_match('/(^|\\.)emailtemplate\\.it$/', $host)) {
|
||||
$envHint = 'prod';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($envHint === null) {
|
||||
if (is_dir(__DIR__ . '/staging')) {
|
||||
$envHint = 'staging';
|
||||
|
||||
Reference in New Issue
Block a user