diff --git a/src/Symfony/Components/Routing/Router.php b/src/Symfony/Components/Routing/Router.php index edc0889bc2..af95b929c3 100644 --- a/src/Symfony/Components/Routing/Router.php +++ b/src/Symfony/Components/Routing/Router.php @@ -254,7 +254,10 @@ class Router implements RouterInterface 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); } }