8000 minor #13667 made the assets optional (fabpot) · symfony/symfony@a0a0b05 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0a0b05

Browse files
committed
minor #13667 made the assets optional (fabpot)
This PR was merged into the 2.7 branch. Discussion ---------- made the assets optional | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Right now, the assets configuration is optional (and the dependency as well on FramewokrBundle), but the asset services and the Asset extension is always loaded. This PR fixes this inconsistency, which will make tests pass again. Commits ------- ddf5ac4 made the assets optional
2 parents 74bdb8f + ddf5ac4 commit a0a0b05

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function load(array $configs, ContainerBuilder $container)
4949
$loader->load('web.xml');
5050
$loader->load('services.xml');
5151
$loader->load('fragment_renderer.xml');
52-
$loader->load('assets.xml');
5352

5453
// A translator must always be registered (as support is included by
5554
// default in the Form component). If disabled, an identity translator
@@ -562,6 +561,8 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB
562561
*/
563562
private function registerAssetsConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
564563
{
564+
$loader->load('assets.xml');
565+
565566
$defaultVersion = $this->createVersion($container, $config['version'], $config['version_format'], '_default');
566567

567568
$defaultPackage = $this->createPackageDefinition($config['base_path'], $config['base_urls'], $defaultVersion);

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset="UTF-8" />
55
<title>{% block title %}Welcome!{% endblock %}</title>
66
{% block stylesheets %}{% endblock %}
7-
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
87
</head>
98
<body>
109
{% block body %}{% endblock %}

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function process(ContainerBuilder $container)
7878
$container->setDefinition('twig.loader.filesystem', $loader);
7979
}
8080

81+
if ($container->has('assets.packages')) {
82+
$loader->addTag('twig.extension');
83+
}
84+
8185
if (method_exists('Symfony\Bridge\Twig\AppVariable', 'setContainer')) {
8286
// we are on Symfony <3.0, where the setContainer method exists
8387
$container->getDefinition('twig.app_variable')->addMethodCall('setContainer', array(new Reference('service_container')));

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
</service>
8787

8888
<service id="twig.extension.assets" class="Symfony\Bridge\Twig\Extension\AssetExtension" public="false">
89-
<tag name="twig.extension" />
9089
<argument type="service" id="assets.packages" />
9190
<argument type="service" id="twig.extension.httpfoundation" />
9291
</service>

0 commit comments

Comments
 (0)
0