diff options
Diffstat (limited to 'vendor/symfony/cache/DependencyInjection/CachePoolClearerPass.php')
-rw-r--r-- | vendor/symfony/cache/DependencyInjection/CachePoolClearerPass.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/symfony/cache/DependencyInjection/CachePoolClearerPass.php b/vendor/symfony/cache/DependencyInjection/CachePoolClearerPass.php new file mode 100644 index 0000000..5449720 --- /dev/null +++ b/vendor/symfony/cache/DependencyInjection/CachePoolClearerPass.php | |||
@@ -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\Cache\DependencyInjection; | ||
13 | |||
14 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
15 | use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
16 | use Symfony\Component\DependencyInjection\Reference; | ||
17 | |||
18 | /** | ||
19 | * @author Nicolas Grekas <p@tchwork.com> | ||
20 | */ | ||
21 | class CachePoolClearerPass implements CompilerPassInterface | ||
22 | { | ||
23 | public function process(ContainerBuilder $container): void | ||
24 | { | ||
25 | $container->getParameterBag()->remove('cache.prefix.seed'); | ||
26 | |||
27 | foreach ($container->findTaggedServiceIds('cache.pool.clearer') as $id => $attr) { | ||
28 | $clearer = $container->getDefinition($id); | ||
29 | $pools = []; | ||
30 | foreach ($clearer->getArgument(0) as $name => $ref) { | ||
31 | if ($container->hasDefinition($ref)) { | ||
32 | $pools[$name] = new Reference($ref); | ||
33 | } | ||
34 | } | ||
35 | $clearer->replaceArgument(0, $pools); | ||
36 | } | ||
37 | } | ||
38 | } | ||