bug #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 | #25326
| License       | MIT
| Doc PR        |

Commits
-------

093eb3d40d register system cache clearer only if it's used
This commit is contained in:
Fabien Potencier 2017-12-07 08:52:37 -08:00
commit 1aa06b8b06
2 changed files with 5 additions and 3 deletions

View File

@ -112,6 +112,10 @@ class CachePoolPass implements CompilerPassInterface
$clearer->setArgument(0, $pools);
}
$clearer->addTag('cache.pool.clearer');
if ('cache.system_clearer' === $id) {
$clearer->addTag('kernel.cache_clearer');
}
}
}

View File

@ -104,9 +104,7 @@
<argument type="collection" />
</service>
<service id="cache.system_clearer" parent="cache.default_clearer" public="true">
<tag name="kernel.cache_clearer" />
</service>
<service id="cache.system_clearer" parent="cache.default_clearer" public="true" />
<service id="cache.global_clearer" parent="cache.default_clearer" public="true" />
<service id="cache.app_clearer" alias="cache.default_clearer" public="true" />