8000 bug #43945 [Runtime] fix defining APP_DEBUG when Dotenv is not enable… · symfony/symfony@a063a28 · GitHub
[go: up one dir, main page]

Skip to content

Commit a063a28

Browse files
committed
bug #43945 [Runtime] fix defining APP_DEBUG when Dotenv is not enabled (nicolas-grekas)
This PR was merged into the 5.3 branch. Discussion ---------- [Runtime] fix defining APP_DEBUG when Dotenv is not enabled | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #43793 | License | MIT | Doc PR | - Commits ------- 189987a [Runtime] fix defining APP_DEBUG when Dotenv is not enabled
2 parents 653e215 + 189987a commit a063a28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Runtime/SymfonyRuntime.php

Lines changed: 2 additions & 1 deletion
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)
0