8000 [Framework] Convert config/error_renderer.xml to php · flack/symfony@213091e · GitHub
[go: up one dir, main page]

Skip to content

Commit 213091e

Browse files
committed
[Framework] Convert config/error_renderer.xml to php
1 parent 1b086ee commit 213091e

File tree

3 files changed

+39
-32
lines changed

3 files changed

+39
-32
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function load(array $configs, ContainerBuilder $container)
176176
$loader->load('web.xml');
177177
$loader->load('services.xml');
178178
$loader->load('fragment_renderer.xml');
179-
$loader->load('error_renderer.xml');
179+
$phpLoader->load('error_renderer.php');
180180

181181
if (interface_exists(PsrEventDispatcherInterface::class)) {
182182
$container->setAlias(PsrEventDispatcherInterface::class, 'event_dispatcher');
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13+
14+
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
15+
16+
return static function (ContainerConfigurator $container) {
17+
$container->services()
18+
->set('error_handler.error_renderer.html', HtmlErrorRenderer::class)
19+
->args([
20+
inline_service()
21+
->factory([HtmlErrorRenderer::class, 'isDebug'])
22+
->args([
23+
service('request_stack'),
24+
param('kernel.debug'),
25+
]),
26+
param('kernel.charset'),
27+
service('debug.file_link_formatter')->nullOnInvalid(),
28+
param('kernel.project_dir'),
29+
inline_service()
30+
->factory([HtmlErrorRenderer::class, 'getAndCleanOutputBuffer'])
31+
->args([service('request_stack')]),
32+
service('logger')->nullOnInvalid(),
33+
])
34+
35+
->alias('error_renderer.html', 'error_handler.error_renderer.html')
36+
->alias('error_renderer', 'error_renderer.html')
37+
;
38+
};

src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0