mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +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);
|
$dir = dirname($file);
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
|
if (false === @mkdir($dir, 0777, true)) {
|
||||||
throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
|
clearstatcache(false, $dir);
|
||||||
|
if (!is_dir($dir)) {
|
||||||
|
throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} elseif (!is_writable($dir)) {
|
} elseif (!is_writable($dir)) {
|
||||||
throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir));
|
throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir));
|
||||||
|
|||||||
Reference in New Issue
Block a user