bug #1868 fixed BC break by allowing null as the cache strategy (fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

fixed BC break by allowing null as the cache strategy

fixes #1851

Commits
-------

d6316d6 fixed BC break by allowing null as the cache strategy
This commit is contained in:
Fabien Potencier
2015-10-13 09:02:05 +02:00
+4
View File
@@ -264,6 +264,10 @@ class Twig_Environment
} elseif (false === $cache) {
$this->originalCache = $cache;
$this->cache = new Twig_Cache_Null();
} elseif (null === $cache) {
@trigger_error('Using "null" as the cache strategy is deprecated and will be removed in Twig 2.0.', E_USER_DEPRECATED);
$this->originalCache = false;
$this->cache = new Twig_Cache_Null();
} elseif ($cache instanceof Twig_CacheInterface) {
$this->originalCache = $this->cache = $cache;
} else {