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.
main
Raphael Kallensee 12 years ago
parent 49238388e4
commit 0be2fd12e4

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

Loading…
Cancel
Save