diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index c1e838f79b..af4ad4c3d8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -176,7 +176,7 @@ class FrameworkExtension extends Extension $loader->load('web.xml'); $loader->load('services.xml'); $loader->load('fragment_renderer.xml'); - $loader->load('error_renderer.xml'); + $phpLoader->load('error_renderer.php'); if (interface_exists(PsrEventDispatcherInterface::class)) { $container->setAlias(PsrEventDispatcherInterface::class, 'event_dispatcher'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.php new file mode 100644 index 0000000000..67f28ce44d --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + +use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer; + +return static function (ContainerConfigurator $container) { + $container->services() + ->set('error_handler.error_renderer.html', HtmlErrorRenderer::class) + ->args([ + inline_service() + ->factory([HtmlErrorRenderer::class, 'isDebug']) + ->args([ + service('request_stack'), + param('kernel.debug'), + ]), + param('kernel.charset'), + service('debug.file_link_formatter')->nullOnInvalid(), + param('kernel.project_dir'), + inline_service() + ->factory([HtmlErrorRenderer::class, 'getAndCleanOutputBuffer']) + ->args([service('request_stack')]), + service('logger')->nullOnInvalid(), + ]) + + ->alias('error_renderer.html', 'error_handler.error_renderer.html') + ->alias('error_renderer', 'error_renderer.html') + ; +}; diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.xml deleted file mode 100644 index 4d2423feee..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - %kernel.debug% - - - %kernel.charset% - - %kernel.project_dir% - - - - - - - - - - - - -