Skip to content

Instantly share code, notes, and snippets.

@ahilles107
Created August 10, 2017 10:32
Show Gist options
  • Save ahilles107/ce27285c9e9f924e5dfd4848d532c8c7 to your computer and use it in GitHub Desktop.
Save ahilles107/ce27285c9e9f924e5dfd4848d532c8c7 to your computer and use it in GitHub Desktop.
<?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