fixed implementation of Null cache

This commit is contained in:
Fabien Potencier
2015-09-16 08:23:18 +02:00
parent 7ffa3a2ae1
commit b43e298ccf
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
* 1.22.2 (2015-XX-XX)
* n/a
* fixed Twig_Cache_Null logic
* 1.22.1 (2015-09-15)
+7 -2
View File
@@ -16,12 +16,14 @@
*/
class Twig_Cache_Null implements Twig_CacheInterface
{
private $buffer = array();
/**
* {@inheritdoc}
*/
public function generateKey($name, $className)
{
return '';
return $className;
}
/**
@@ -37,7 +39,7 @@ class Twig_Cache_Null implements Twig_CacheInterface
*/
public function write($key, $content)
{
eval('?>'.$content);
$this->buffer[$key] = $content;
}
/**
@@ -45,6 +47,9 @@ class Twig_Cache_Null implements Twig_CacheInterface
*/
public function load($key)
{
eval('?>'.$this->buffer[$key]);
unset($this->buffer[$key]);
}
/**