diff --git a/CHANGELOG b/CHANGELOG index 1acde1da8..d810115b2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.22.0 (2015-XX-XX) + * changed template cache names to take into account enabled extensions * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), and Twig_Environment::writeCacheFile() * added a way to override the filesystem template cache system diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 695eff527..970d7fa21 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -298,7 +298,9 @@ class Twig_Environment */ public function getTemplateClass($name, $index = null) { - return $this->templateClassPrefix.hash('sha256', $this->getLoader()->getCacheKey($name)).(null === $index ? '' : '_'.$index); + $key = $this->getLoader()->getCacheKey($name).'__'.implode('__', array_keys($this->extensions)); + + return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index); } /** diff --git a/test/Twig/Tests/Node/ModuleTest.php b/test/Twig/Tests/Node/ModuleTest.php index 5688af8cc..19a4be9ff 100644 --- a/test/Twig/Tests/Node/ModuleTest.php +++ b/test/Twig/Tests/Node/ModuleTest.php @@ -46,7 +46,7 @@ class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase