浏览代码

Remove junctions with PHP rather than system rmdir

PHP will happily remove junctions using its `rmdir` function (tested on
versions back to 5.2.17). This saves invoking system `rmdir` through
cmd.exe.
johnstevenson 6 年之前
父节点
当前提交
d1cf69fa92
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      src/Composer/Util/Filesystem.php

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

@@ -692,9 +692,7 @@ class Filesystem
         if (!$this->isJunction($junction)) {
             throw new IOException(sprintf('%s is not a junction and thus cannot be removed as one', $junction));
         }
-        $cmd = sprintf('rmdir /S /Q %s', ProcessExecutor::escape($junction));
-        clearstatcache(true, $junction);
 
-        return ($this->getProcess()->execute($cmd, $output) === 0);
+        return $this->rmdir($junction);
     }
 }