From 84f3753b338de8657b206cfe3337f92cf3f7e87f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 16 Jan 2015 17:37:04 +0100 Subject: [PATCH] fixed some deprecated notices --- .../DependencyInjection/Compiler/ExtensionPass.php | 5 +++++ src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php index b325836281..7ae9e78e54 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php @@ -13,6 +13,7 @@ namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Reference; /** @@ -63,6 +64,10 @@ class ExtensionPass implements CompilerPassInterface $container->getDefinition('twig.extension.code')->replaceArgument(0, $container->getParameter('templating.helper.code.file_link_format')); } + if (!$container->has('security.token_storage')) { + $container->getDefinition('twig.app_variable')->addMethodCall('setSecurity', array(new Reference('security.context', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))); + } + if ($container->has('templating')) { $container->getDefinition('twig.cache_warmer')->addTag('kernel.cache_warmer'); diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml index 2d46cdb5aa..3f82a3a095 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml +++ b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml @@ -41,7 +41,6 @@ %kernel.environment% %kernel.debug% -