1
0
Fork 0

Add warnings if OpenSSL is not enabled, fixes #84

pull/80/merge
Jordi Boggiano 2011-11-03 19:58:49 +01:00
parent 82c1170fa1
commit 0cfbea624e
2 changed files with 8 additions and 0 deletions

View File

@ -50,6 +50,10 @@ 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');
}
copy($url, $fileName);
if (!file_exists($fileName)) {

View File

@ -36,6 +36,10 @@ class GitDownloader implements DownloaderInterface
throw new \InvalidArgumentException('The given package is missing reference information');
}
if (!extension_loaded('openssl')) {
throw new \RuntimeException('You must enable the openssl extension to clone git repositories');
}
$url = escapeshellarg($package->getSourceUrl());
$ref = escapeshellarg($package->getSourceReference());
system(sprintf('git clone %s %s && cd %2$s && git reset --hard %s', $url, $path, $ref));