瀏覽代碼

Merge pull request #2985 from tristanlins/hotfix/filesystem-remove-directory

Graceful fallback in Filesystem::removeDirectory() to php
Jordi Boggiano 10 年之前
父節點
當前提交
43a72d1132
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/Composer/Util/Filesystem.php

+ 7 - 3
src/Composer/Util/Filesystem.php

@@ -85,10 +85,14 @@ class Filesystem
 
         $result = $this->getProcess()->execute($cmd, $output) === 0;
 
-        // clear stat cache because external processes aren't tracked by the php stat cache
-        clearstatcache();
+        if ($result) {
+            // clear stat cache because external processes aren't tracked by the php stat cache
+            clearstatcache();
+
+            return !is_dir($directory);
+        }
 
-        return $result && !is_dir($directory);
+        return $this->removeDirectoryPhp($directory);
     }
 
     /**