mirror of
https://github.com/Mactronique/phpcache-bundle.git
synced 2026-03-24 08:52:07 +01:00
32 lines
906 B
PHP
32 lines
906 B
PHP
<?php
|
|
|
|
namespace Mactronique\Bundle\PhpCacheBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
class DriverCompilerPass implements CompilerPassInterface
|
|
{
|
|
public function process(ContainerBuilder $container)
|
|
{
|
|
if (!$container->hasDefinition('mactronique_cache.phpcache')) {
|
|
return;
|
|
}
|
|
|
|
$definition = $container->getDefinition(
|
|
'mactronique_cache.phpcache'
|
|
);
|
|
|
|
$taggedServices = $container->findTaggedServiceIds(
|
|
'mactronique_cache.driver'
|
|
);
|
|
foreach ($taggedServices as $id => $attributes) {
|
|
$definition->addMethodCall(
|
|
'registerDriver',
|
|
array(new Reference($id))
|
|
);
|
|
}
|
|
}
|
|
}
|