1
0
Fork 0

Add more debug info on cache write failure, refs #4249

pull/4345/head
Jordi Boggiano 2015-08-10 10:07:48 +01:00
parent 65bb8d99f4
commit 812523f1ab
1 changed files with 3 additions and 0 deletions

View File

@ -86,6 +86,9 @@ class Cache
try {
return file_put_contents($this->root . $file, $contents);
} catch (\ErrorException $e) {
if ($this->io->isDebug()) {
$this->io->writeError('<warning>Failed to write into cache: '.$e->getMessage().'</warning>');
}
if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) {
// Remove partial file.
unlink($this->root . $file);