[HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI
This commit is contained in:
parent
f6f6a600a8
commit
3f995ac602
@ -65,6 +65,9 @@ class DebugHandlersListener implements EventSubscriberInterface
|
||||
*/
|
||||
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;
|
||||
}
|
||||
@ -148,7 +151,7 @@ class DebugHandlersListener implements EventSubscriberInterface
|
||||
{
|
||||
$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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user