|
58 | 58 | use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass;
|
59 | 59 | use Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass;
|
60 | 60 | use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass;
|
| 61 | +use Symfony\Component\Runtime\SymfonyRuntime; |
61 | 62 | use Symfony\Component\Scheduler\DependencyInjection\AddScheduleMessengerPass;
|
62 | 63 | use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
|
63 | 64 | use Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass;
|
@@ -99,13 +100,19 @@ public function boot()
|
99 | 100 | {
|
100 | 101 | $_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger';
|
101 | 102 |
|
102 |
| - $handler = ErrorHandler::register(null, false); |
| 103 | + if (class_exists(SymfonyRuntime::class)) { |
| 104 | + $handler = set_error_handler('var_dump'); |
| 105 | + restore_error_handler(); |
| 106 | + } else { |
| 107 | + $handler = [ErrorHandler::register(null, false)]; |
| 108 | + } |
103 | 109 |
|
104 |
| - // When upgrading an existing Symfony application from 6.2 to 6.3, and |
105 |
| - // the cache is warmed up, the service is not available yet, so we need |
106 |
| - // to check if it exists. |
107 |
| - if ($this->container->has('debug.error_handler_configurator')) { |
108 |
| - $this->container->get('debug.error_handler_configurator')->configure($handler); |
| 110 | + if (!$this->container->has('debug.error_handler_configurator')) { |
| 111 | + // When upgrading an existing Symfony application from 6.2 to 6.3, and |
| 112 | + // the cache is warmed up, the service is not available yet, so we need |
| 113 | + // to check if it exists. |
| 114 | + } elseif (\is_array($handler) && $handler[0] instanceof ErrorHandler) { |
| 115 | + $this->container->get('debug.error_handler_configurator')->configure($handler[0]); |
109 | 116 | }
|
110 | 117 |
|
111 | 118 | if ($this->container->getParameter('kernel.http_method_override')) {
|
|
0 commit comments