Skip to content

Commit

Permalink
bug #2125 fixed Twig cache sharing when used with different versions …
Browse files Browse the repository at this point in the history
…of PHP (fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

fixed Twig cache sharing when used with different versions of PHP

closes #2013

Commits
-------

ecd020d fixed Twig cache sharing when used with different versions of PHP
  • Loading branch information
fabpot committed Sep 20, 2016
2 parents 03dd9c5 + ecd020d commit 2fec9d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,5 +1,6 @@
* 1.25.0 (2016-XX-XX)

* fixed Twig cache sharing when used with different versions of PHP
* removed embed parent workaround for simple use cases
* deprecated the ability to store non Node instances in Node::$nodes
* deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler()
Expand Down
1 change: 1 addition & 0 deletions lib/Twig/Environment.php
Expand Up @@ -312,6 +312,7 @@ public function getTemplateClass($name, $index = null)
$key = $this->getLoader()->getCacheKey($name);
$key .= json_encode(array_keys($this->extensions));
$key .= function_exists('twig_template_get_attributes');
$key .= ':'.PHP_MAJOR_VERSION.':'.PHP_MINOR_VERSION;

return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
}
Expand Down

0 comments on commit 2fec9d4

Please sign in to comment.