mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
fixed implementation of Null cache
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
* 1.22.2 (2015-XX-XX)
|
||||
|
||||
* n/a
|
||||
* fixed Twig_Cache_Null logic
|
||||
|
||||
* 1.22.1 (2015-09-15)
|
||||
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user