mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
changed template cache names to take into account the Twig C extension
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
* 1.22.3 (2015-XX-XX)
|
* 1.22.3 (2015-XX-XX)
|
||||||
|
|
||||||
* n/a
|
* changed template cache names to take into account the Twig C extension
|
||||||
|
|
||||||
* 1.22.2 (2015-09-22)
|
* 1.22.2 (2015-09-22)
|
||||||
|
|
||||||
|
|||||||
@@ -291,6 +291,12 @@ class Twig_Environment
|
|||||||
/**
|
/**
|
||||||
* Gets the template class associated with the given string.
|
* Gets the template class associated with the given string.
|
||||||
*
|
*
|
||||||
|
* The generated template class is based on the following parameters:
|
||||||
|
*
|
||||||
|
* * The cache key for the given template;
|
||||||
|
* * The currently enabled extensions;
|
||||||
|
* * Whether the Twig C extension is available or not.
|
||||||
|
*
|
||||||
* @param string $name The name for which to calculate the template class name
|
* @param string $name The name for which to calculate the template class name
|
||||||
* @param int $index The index if it is an embedded template
|
* @param int $index The index if it is an embedded template
|
||||||
*
|
*
|
||||||
@@ -300,6 +306,10 @@ class Twig_Environment
|
|||||||
{
|
{
|
||||||
$key = $this->getLoader()->getCacheKey($name).'__'.implode('__', array_keys($this->extensions));
|
$key = $this->getLoader()->getCacheKey($name).'__'.implode('__', array_keys($this->extensions));
|
||||||
|
|
||||||
|
if (function_exists('twig_template_get_attributes')) {
|
||||||
|
$key .= '__cext';
|
||||||
|
}
|
||||||
|
|
||||||
return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
|
return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user