Created
August 10, 2017 10:32
-
-
Save ahilles107/ce27285c9e9f924e5dfd4848d532c8c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace SWP\Bundle\CoreBundle\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Reference; | |
final class AddCustomTwigCachePass extends AbstractOverridePass | |
{ | |
public function process(ContainerBuilder $container) | |
{ | |
if (false === $container->getParameter('kernel.debug')) { | |
$twig = $this->getDefinitionIfExists($container, 'twig'); | |
$twig->addMethodCall( | |
'setCache', [new Reference('swp.twig.cache.tenant_aware')] | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment