8000 bug #36342 [HttpKernel][FrameworkBundle] fix compat with Debug compon… · enflow/symfony@a56f98c · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit a56f98c

Browse files
committed
bug symfony#36342 [HttpKernel][FrameworkBundle] fix compat with Debug component (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel][FrameworkBundle] fix compat with Debug component | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#36009 | License | MIT | Doc PR | - Fixes the issue as described by @stof in symfony#36009 Commits ------- d5c54c2 [HttpKernel][FrameworkBundle] fix compat with Debug component
2 parents d33392f + d5c54c2 commit a56f98c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use Symfony\Component\Cache\DependencyInjection\CachePoolPrunerPass;
3636
use Symfony\Component\Config\Resource\ClassExistenceResource;
3737
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
38+
use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
3839
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
3940
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
4041
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -89,6 +90,9 @@ class FrameworkBundle extends Bundle
8990
public function boot()
9091
{
9192
ErrorHandler::register(null, false)->throwAt($this->container->getParameter('debug.error_handler.throw_at'), true);
93+
if (class_exists(LegacyErrorHandler::class, false)) {
94+
LegacyErrorHandler::register(null, false)->throwAt($this->container->getParameter('debug.error_handler.throw_at'), true);
95+
}
9296

9397
if ($this->container->getParameter('kernel.http_method_override')) {
9498
Request::enableHttpMethodParameterOverride();

src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php

Lines changed: 3 additions & 2 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\ConsoleEvents;
1616
use Symfony\Component\Console\Event\ConsoleEvent;
1717
use Symfony\Component\Console\Output\ConsoleOutputInterface;
18+
use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
1819
use Symfony\Component\Debug\Exception\FatalThrowableError;
1920
use Symfony\Component\ErrorHandler\ErrorHandler;
2021
use Symfony\Component\EventDispatcher\Event;
@@ -79,7 +80,7 @@ public function configure(Event $event = null)
7980
restore_exception_handler();
8081

8182
if ($this->logger || null !== $this->throwAt) {
82-
if ($handler instanceof ErrorHandler) {
83+
if ($handler instanceof ErrorHandler || $handler instanceof LegacyErrorHandler) {
8384
if ($this->logger) {
8485
$handler->setDefaultLogger($this->logger, $this->levels);
8586
if (\is_array($this->levels)) {
@@ -138,7 +139,7 @@ public function configure(Event $event = null)
138139
}
139140
}
140141
if ($this->exceptionHandler) {
141-
if ($handler instanceof ErrorHandler) {
142+
if ($handler instanceof ErrorHandler || $handler instanceof LegacyErrorHandler) {
142143
$handler->setExceptionHandler($this->exceptionHandler);
143144
}
144145
$this->exceptionHandler = null;

0 commit comments

Comments
 (0)
0