Merge branch '1.X' into 2.x

* 1.X:
  fixed PHP 5.2 compat
This commit is contained in:
Fabien Potencier
2017-03-22 08:24:50 -07:00
+3 -1
View File
@@ -50,7 +50,9 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
$dir = dirname($key);
if (!is_dir($dir)) {
if (false === @mkdir($dir, 0777, true)) {
clearstatcache(true, $dir);
if (PHP_VERSION_ID >= 50300) {
clearstatcache(true, $dir);
}
if (!is_dir($dir)) {
throw new RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir));
}