Skip to content

Commit 1aa06b8

Browse files
committed
bug symfony#25380 [FrameworkBundle][Cache] register system cache clearer only if it's used (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle][Cache] register system cache clearer only if it's used | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#25326 | License | MIT | Doc PR | Commits ------- 093eb3d register system cache clearer only if it's used
2 parents d57303f + 093eb3d commit 1aa06b8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ public function process(ContainerBuilder $container)
112112
$clearer->setArgument(0, $pools);
113113
}
114114
$clearer->addTag('cache.pool.clearer');
115+
116+
if ('cache.system_clearer' === $id) {
117+
$clearer->addTag('kernel.cache_clearer');
118+
}
115119
}
116120
}
117121

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@
104104
<argument type="collection" />
105105
</service>
106106

107-
<service id="cache.system_clearer" parent="cache.default_clearer" public="true">
108-
<tag name="kernel.cache_clearer" />
109-
</service>
107+
<service id="cache.system_clearer" parent="cache.default_clearer" public="true" />
110108

111109
<service id="cache.global_clearer" parent="cache.default_clearer" public="true" />
112110
<service id="cache.app_clearer" alias="cache.default_clearer" public="true" />

0 commit comments

Comments
 (0)