From ece954a7a46515b2b6a083985c48c3ff42d02f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9A=D1=83=D1=80=D0=B0?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2?= Date: Sun, 5 Aug 2012 02:38:47 +0300 Subject: [PATCH] Update src/Composer/Downloader/ArchiveDownloader.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for single-file archives, for example http://sourceforge.net/projects/rssphp/files/rssphp/v1/rss_php.v1.zip/download --- src/Composer/Downloader/ArchiveDownloader.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index ed113e0d4..0f7ae0436 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -58,7 +58,13 @@ abstract class ArchiveDownloader extends FileDownloader rename($file, $path . '/' . basename($file)); } } - rmdir($contentDir); + + if(is_file($contentDir)){ + unlink($contentDir); + } + else{ + rmdir($contentDir); + } } } catch (\Exception $e) { // clean up