Skip to content

Commit 189987a

Browse files
[Runtime] fix defining APP_DEBUG when Dotenv is not enabled
1 parent 653e215 commit 189987a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Runtime/SymfonyRuntime.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public function __construct(array $options = [])
103103
$options['debug'] ?? $options['debug'] = '1' === $_SERVER['APP_DEBUG'];
104104
$options['disable_dotenv'] = true;
105105
} else {
106-
$_SERVER['APP_ENV'] ?? $_SERVER['APP_ENV'] = 'dev';
106+
$_SERVER['APP_ENV'] ?? $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] ?? 'dev';
107+
$_SERVER['APP_DEBUG'] ?? $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] ?? !\in_array($_SERVER['APP_ENV'], (array) ($options['prod_envs'] ?? ['prod']), true);
107108
}
108109

109110
$options['error_handler'] ?? $options['error_handler'] = SymfonyErrorHandler::class;

0 commit comments

Comments
 (0)