Skip to content

Commit

Permalink
[HttpKernel] fix registering DebugHandlersListener regardless of the …
Browse files Browse the repository at this point in the history
…PHP_SAPI
  • Loading branch information
nicolas-grekas committed Feb 14, 2020
1 parent f6f6a60 commit 3f995ac
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -65,6 +65,9 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
*/
public function configure(Event $event = null)
{
if ($event instanceof ConsoleEvent && !\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
return;
}
if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMasterRequest()) {
return;
}
Expand Down Expand Up @@ -148,7 +151,7 @@ public static function getSubscribedEvents()
{
$events = [KernelEvents::REQUEST => ['configure', 2048]];

if ('cli' === \PHP_SAPI && \defined('Symfony\Component\Console\ConsoleEvents::COMMAND')) {
if (\defined('Symfony\Component\Console\ConsoleEvents::COMMAND')) {
$events[ConsoleEvents::COMMAND] = ['configure', 2048];
}

Expand Down

0 comments on commit 3f995ac

Please sign in to comment.