瀏覽代碼

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

Jordi Boggiano 10 年之前
父節點
當前提交
812523f1ab
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/Composer/Cache.php

+ 3 - 0
src/Composer/Cache.php

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