[Routing] Fixed fatal error when the permission to write cache files was denied

This commit is contained in:
Bernhard Schussek 2010-06-22 21:01:18 +02:00 committed by Fabien Potencier
parent 0e3b88a058
commit 7f94fc7f73
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}