From 5f86037ff307ff985e62e380b6ef1f07ece29d15 Mon Sep 17 00:00:00 2001 From: Tristan Lins Date: Mon, 12 May 2014 23:12:57 +0200 Subject: [PATCH] Graceful fallback in Filesystem::removeDirectory() to php, if process failed. --- src/Composer/Util/Filesystem.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index 8771776fc..d88e00393 100644 --- a/src/Composer/Util/Filesystem.php +++ b/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 $result && !is_dir($directory); + return !is_dir($directory); + } + + return $this->removeDirectoryPhp($directory); } /**