Make "APP_DEBUG" mode fallback to "APP_ENV !== prod"

This commit is contained in:
Nicolas Grekas
2017-11-07 17:24:19 +01:00
parent 7845f3cba4
commit b758d3a313
2 changed files with 3 additions and 3 deletions
@@ -12,7 +12,7 @@ if (!isset($_SERVER['APP_ENV'])) {
(new Dotenv())->load(__DIR__.'/../.env');
}
if ($_SERVER['APP_DEBUG'] ?? false) {
if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {
umask(0000);
Debug::enable();
@@ -20,7 +20,7 @@ if ($_SERVER['APP_DEBUG'] ?? false) {
// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();