mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
The results of is_dir() are cached
So before calling is_dir() for the second time, clearstatcache of the dir
This commit is contained in:
@@ -1232,8 +1232,11 @@ class Twig_Environment
|
||||
{
|
||||
$dir = dirname($file);
|
||||
if (!is_dir($dir)) {
|
||||
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
|
||||
throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
|
||||
if (false === @mkdir($dir, 0777, true)) {
|
||||
clearstatcache(false, $dir);
|
||||
if (!is_dir($dir)) {
|
||||
throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
|
||||
}
|
||||
}
|
||||
} elseif (!is_writable($dir)) {
|
||||
throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir));
|
||||
|
||||
Reference in New Issue
Block a user