Skip to content

Commit a2844c0

Browse files
committed
bug symfony#25162 [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Needed so that we can set the env var from `phpunit.xml.dist`. Commits ------- 7de1af4 [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY
2 parents 7c0a59f + 7de1af4 commit a2844c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/Log/Logger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function __construct($minLevel = null, $output = 'php://stderr', callable
4242
if (null === $minLevel) {
4343
$minLevel = LogLevel::WARNING;
4444

45-
if (isset($_SERVER['SHELL_VERBOSITY'])) {
46-
switch ((int) $_SERVER['SHELL_VERBOSITY']) {
45+
if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) {
46+
switch ((int) (isset($_ENV['SHELL_VERBOSITY']) ? $_ENV['SHELL_VERBOSITY'] : $_SERVER['SHELL_VERBOSITY'])) {
4747
case -1: $minLevel = LogLevel::ERROR; break;
4848
case 1: $minLevel = LogLevel::NOTICE; break;
4949
case 2: $minLevel = LogLevel::INFO; break;

0 commit comments

Comments
 (0)