From 3ad905ae99e34e2af500133e6a2e8aac6fdbd80f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 15 Nov 2011 11:07:05 +0100 Subject: [PATCH] Lift openssl requirement for github archives (thanks @pborreli) --- src/Composer/Downloader/FileDownloader.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 67ee6057d..1e2af382e 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -51,7 +51,12 @@ abstract class FileDownloader implements DownloaderInterface echo 'Downloading '.$url.' to '.$fileName.PHP_EOL; if (0 === strpos($url, 'https:') && !extension_loaded('openssl')) { - throw new \RuntimeException('You must enable the openssl extension to download files via https'); + // bypass https for github if openssl is disabled + if (preg_match('{^https://(github.com/[^/]+/[^/]+/(zip|tar)ball/[^/]+)$}i', $url, $match)) { + $url = 'http://nodeload.'.$match[1]; + } else { + throw new \RuntimeException('You must enable the openssl extension to download files via https'); + } } copy($url, $fileName);