Skip to content

Commit

Permalink
[Runtime] fix defining APP_DEBUG when Dotenv is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 5, 2021
1 parent 29c2073 commit 0345ba5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SymfonyRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public function __construct(array $options = [])
$options['debug'] ?? $options['debug'] = '1' === $_SERVER['APP_DEBUG'];
$options['disable_dotenv'] = true;
} else {
$_SERVER['APP_ENV'] ?? $_SERVER['APP_ENV'] = 'dev';
$_SERVER['APP_ENV'] ?? $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] ?? 'dev';
$_SERVER['APP_DEBUG'] ?? $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] ?? !\in_array($_SERVER['APP_ENV'], (array) ($options['prod_envs'] ?? ['prod']), true);
}

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

0 comments on commit 0345ba5

Please sign in to comment.