From 0be2fd12e4d6833847b5471eedae23fc910d5dd1 Mon Sep 17 00:00:00 2001 From: Raphael Kallensee Date: Fri, 23 Nov 2012 18:08:32 +0100 Subject: [PATCH 1/2] 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. --- src/Composer/Repository/PearRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/PearRepository.php b/src/Composer/Repository/PearRepository.php index 684a64df6..864738c34 100644 --- a/src/Composer/Repository/PearRepository.php +++ b/src/Composer/Repository/PearRepository.php @@ -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(); From 9713bf8becc06b3a6b431072b71d52fb007ac56c Mon Sep 17 00:00:00 2001 From: Raphael Kallensee Date: Fri, 23 Nov 2012 18:35:22 +0100 Subject: [PATCH 2/2] Fix for PearRepository scheme handling, broke ChannelReaderTest. --- src/Composer/Repository/PearRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/PearRepository.php b/src/Composer/Repository/PearRepository.php index 864738c34..8c5d9362b 100644 --- a/src/Composer/Repository/PearRepository.php +++ b/src/Composer/Repository/PearRepository.php @@ -107,7 +107,7 @@ class PearRepository extends ArrayRepository // distribution url must be read from /r/{packageName}/{version}.xml::/r/g:text() // but this location is 'de-facto' standard $urlBits = parse_url($this->url); - $scheme = ('https' === $urlBits['scheme'] && extension_loaded('openssl')) ? 'https' : 'http'; + $scheme = (isset($urlBits['scheme']) && 'https' === $urlBits['scheme'] && extension_loaded('openssl')) ? 'https' : 'http'; $distUrl = "{$scheme}://{$packageDefinition->getChannelName()}/get/{$packageDefinition->getPackageName()}-{$version}.tgz"; $requires = array();