Skip to content

Commit 1132d40

Browse files
tuanminhgpTobion
authored andcommitted
Move configuration to PHP
1 parent 6f6e4ce commit 1132d40

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function load(array $configs, ContainerBuilder $container)
365365

366366
$propertyInfoEnabled = $this->isConfigEnabled($container, $config['property_info']);
367367
$this->registerValidationConfiguration($config['validation'], $container, $phpLoader, $propertyInfoEnabled);
368-
$this->registerEsiConfiguration($config['esi'], $container, $loader);
368+
$this->registerEsiConfiguration($config['esi'], $container, $phpLoader);
369369
$this->registerSsiConfiguration($config['ssi'], $container, $phpLoader);
370370
$this->registerFragmentsConfiguration($config['fragments'], $container, $phpLoader);
371371
$this->registerTranslatorConfiguration($config['translator'], $container, $phpLoader, $config['default_locale']);
@@ -532,15 +532,15 @@ private function registerFormConfiguration(array $config, ContainerBuilder $cont
532532
}
533533
}
534534

535-
private function registerEsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
535+
private function registerEsiConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)
536536
{
537537
if (!$this->isConfigEnabled($container, $config)) {
538538
$container->removeDefinition('fragment.renderer.esi');
539539

540540
return;
541541
}
542542

543-
$loader->load('esi.xml');
543+
$loader->load('esi.php');
544544
}
545545

546546
private function registerSsiConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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\HttpKernel\EventListener\SurrogateListener;
15+
use Symfony\Component\HttpKernel\HttpCache\Esi;
16+
17+
return static function (ContainerConfigurator $container) {
18+
$container->services()
19+
->set('esi', Esi::class)
20+
21+
->set('esi_listener', SurrogateListener::class)
22+
->args([service('esi')->ignoreOnInvalid()])
23+
->tag('kernel.event_subscriber')
24+
;
25+
};

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

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

0 commit comments

Comments
 (0)