From a26b36fc343b171b3cf6a75d0896381b37612648 Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Fri, 30 Oct 2015 15:59:12 +0100 Subject: [PATCH] Implement cross platform solution for deleting directory symlinks Windows needs rmdir(), but we always try unlink() first --- modman.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modman.php b/modman.php index 857502c..8a93035 100644 --- a/modman.php +++ b/modman.php @@ -1171,8 +1171,9 @@ public function doRemoveResource($sElementPath){ if (is_link($sElementPath) OR $this->isFolderEmpty($sElementPath)){ // workaround for windows to delete read-only flag // which prevents link from being deleted properly - chmod($sElementPath, 0777); - rmdir($sElementPath); + chmod($sElementPath, 0777); + // directory symlinks must be deleted with rmdir on windows + @unlink($sElementPath) or rmdir($sElementPath); } } elseif (is_file($sElementPath)){ // workaround for windows to delete read-only flag