[Routing] Fixed fatal error when the permission to write cache files was denied
This commit is contained in:
parent
0e3b88a058
commit
7f94fc7f73
@ -254,7 +254,10 @@ class Router implements RouterInterface
|
|||||||
throw new \RuntimeException(sprintf('Failed to write cache file "%s" (cache corrupted).', $tmpFile));
|
throw new \RuntimeException(sprintf('Failed to write cache file "%s" (cache corrupted).', $tmpFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
@rename($tmpFile, $file);
|
if (!@rename($tmpFile, $file)) {
|
||||||
|
throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file));
|
||||||
|
}
|
||||||
|
|
||||||
chmod($file, 0644);
|
chmod($file, 0644);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user