Skip to content

Commit c02610e

Browse files
bug #52205 [HttpKernel] Fix BC (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpKernel] Fix BC | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- a17efc3 [HttpKernel] Fix BC
2 parents 02702a2 + a17efc3 commit c02610e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/HttpKernel/DependencyInjection/LoggerPass.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Log\LoggerInterface;
1515
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
17-
use Symfony\Component\DependencyInjection\Definition;
1817
use Symfony\Component\DependencyInjection\Reference;
1918
use Symfony\Component\HttpFoundation\RequestStack;
2019
use Symfony\Component\HttpKernel\Log\Logger;
@@ -37,7 +36,11 @@ public function process(ContainerBuilder $container)
3736
return;
3837
}
3938

40-
$debug = $container->getParameter('kernel.debug') && $container->getParameter('kernel.runtime_mode.web');
39+
if ($debug = $container->getParameter('kernel.debug')) {
40+
$debug = $container->hasParameter('kernel.runtime_mode.web')
41+
? $container->getParameter('kernel.runtime_mode.web')
42+
: !\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true);
43+
}
4144

4245
$container->register('logger', Logger::class)
4346
->setArguments([null, null, null, new Reference(RequestStack::class), $debug]);

0 commit comments

Comments
 (0)