1
0
Fork 0

Fix for PEAR package downloading in PearRepository: now using https as

scheme if the PEAR channel uses https. The old behavior broke installing
PEAR packages from https-only PEAR channels.
pull/1353/head
Raphael Kallensee 2012-11-23 18:08:32 +01:00
parent 49238388e4
commit 0be2fd12e4
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ class PearRepository extends ArrayRepository
// distribution url must be read from /r/{packageName}/{version}.xml::/r/g:text()
// but this location is 'de-facto' standard
$distUrl = "http://{$packageDefinition->getChannelName()}/get/{$packageDefinition->getPackageName()}-{$version}.tgz";
$urlBits = parse_url($this->url);
$scheme = ('https' === $urlBits['scheme'] && extension_loaded('openssl')) ? 'https' : 'http';
$distUrl = "{$scheme}://{$packageDefinition->getChannelName()}/get/{$packageDefinition->getPackageName()}-{$version}.tgz";
$requires = array();
$suggests = array();