Fixed fatal error when the permission to write cache files was denied
This commit is contained in:
parent
7f94fc7f73
commit
4a742138e6
|
@ -95,7 +95,10 @@ class ClassCollectionLoader
|
|||
die(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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -427,7 +427,10 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
|
|||
die(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);
|
||||
}
|
||||
|
||||
|
|
|
@ -384,7 +384,10 @@ class ClassCollectionLoader
|
|||
die(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);
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue