Skip to content

Commit

Permalink
bug #1833 fixed implementation of Null cache (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.x branch.

Discussion
----------

fixed implementation of Null cache

fixes #1832

Commits
-------

b43e298 fixed implementation of Null cache
  • Loading branch information
fabpot committed Sep 16, 2015
2 parents 7ffa3a2 + b43e298 commit 9fde02f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
@@ -1,6 +1,6 @@
* 1.22.2 (2015-XX-XX)

* n/a
* fixed Twig_Cache_Null logic

* 1.22.1 (2015-09-15)

Expand Down
9 changes: 7 additions & 2 deletions lib/Twig/Cache/Null.php
Expand Up @@ -16,12 +16,14 @@
*/
class Twig_Cache_Null implements Twig_CacheInterface
{
private $buffer = array();

/**
* {@inheritdoc}
*/
public function generateKey($name, $className)
{
return '';
return $className;
}

/**
Expand All @@ -37,14 +39,17 @@ public function has($key)
*/
public function write($key, $content)
{
eval('?>'.$content);
$this->buffer[$key] = $content;
}

/**
* {@inheritdoc}
*/
public function load($key)
{
eval('?>'.$this->buffer[$key]);

unset($this->buffer[$key]);
}

/**
Expand Down

0 comments on commit 9fde02f

Please sign in to comment.