fixed BC break by allowing null as the cache strategy

This commit is contained in:
Fabien Potencier
2015-10-12 09:13:33 +02:00
parent e624d0849e
commit d6316d6428
+4
View File
@@ -263,6 +263,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 {