Skip to content

Commit

Permalink
bug #35718 [HttpKernel] fix registering DebugHandlersListener regardl…
Browse files Browse the repository at this point in the history
…ess of the PHP_SAPI (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #35579 (comment)
| License       | MIT
| Doc PR        | -

Commits
-------

3f995ac [HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI
  • Loading branch information
fabpot committed Feb 15, 2020
2 parents f6f6a60 + 3f995ac commit 926e19c
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 926e19c

Please sign in to comment.