1
0
Fork 0

Lift openssl requirement for github archives (thanks @pborreli)

pull/104/merge
Jordi Boggiano 2011-11-15 11:07:05 +01:00
parent 61d17524b8
commit 3ad905ae99
1 changed files with 6 additions and 1 deletions

View File

@ -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);