|
@@ -52,10 +52,12 @@ EOT
|
|
$output->write('Checking http connectivity: ');
|
|
$output->write('Checking http connectivity: ');
|
|
$this->outputResult($output, $this->checkHttp());
|
|
$this->outputResult($output, $this->checkHttp());
|
|
|
|
|
|
- $opts = stream_context_get_options(StreamContextFactory::getContext());
|
|
|
|
|
|
+ $opts = stream_context_get_options(StreamContextFactory::getContext('http://example.org'));
|
|
if (!empty($opts['http']['proxy'])) {
|
|
if (!empty($opts['http']['proxy'])) {
|
|
$output->write('Checking HTTP proxy: ');
|
|
$output->write('Checking HTTP proxy: ');
|
|
$this->outputResult($output, $this->checkHttpProxy());
|
|
$this->outputResult($output, $this->checkHttpProxy());
|
|
|
|
+ $output->write('Checking HTTP proxy support for request_fulluri: ');
|
|
|
|
+ $this->outputResult($output, $this->checkHttpProxyFullUriRequestParam());
|
|
$output->write('Checking HTTPS proxy support for request_fulluri: ');
|
|
$output->write('Checking HTTPS proxy support for request_fulluri: ');
|
|
$this->outputResult($output, $this->checkHttpsProxyFullUriRequestParam());
|
|
$this->outputResult($output, $this->checkHttpsProxyFullUriRequestParam());
|
|
}
|
|
}
|
|
@@ -142,29 +144,54 @@ EOT
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Due to various proxy servers configurations, some servers cant handle non-standard HTTP "http_proxy_request_fulluri" parameter,
|
|
|
|
|
|
+ * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
|
|
* and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
|
|
* and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
|
|
* This method will test, if you need to disable this parameter via setting extra environment variable in your system.
|
|
* This method will test, if you need to disable this parameter via setting extra environment variable in your system.
|
|
*
|
|
*
|
|
* @return bool|string
|
|
* @return bool|string
|
|
*/
|
|
*/
|
|
- private function checkHttpsProxyFullUriRequestParam()
|
|
|
|
|
|
+ private function checkHttpProxyFullUriRequestParam()
|
|
{
|
|
{
|
|
- $url = 'https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0 ';
|
|
|
|
|
|
+ $url = 'http://packagist.org/packages.json';
|
|
try {
|
|
try {
|
|
- $rfcResult = $this->rfs->getContents('api.github.com', $url, false);
|
|
|
|
|
|
+ $this->rfs->getContents('packagist.org', $url, false);
|
|
} catch (TransportException $e) {
|
|
} catch (TransportException $e) {
|
|
- if (!extension_loaded('openssl')) {
|
|
|
|
- return 'You need the openssl extension installed for this check';
|
|
|
|
|
|
+ try {
|
|
|
|
+ $this->rfs->getContents('packagist.org', $url, false, array('http' => array('request_fulluri' => false)));
|
|
|
|
+ } catch (TransportException $e) {
|
|
|
|
+ return 'Unable to assert the situation, maybe packagist.org is down ('.$e->getMessage().')';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return 'It seems there is a problem with your proxy server, try setting the "HTTP_PROXY_REQUEST_FULLURI" and "HTTPS_PROXY_REQUEST_FULLURI" environment variables to "false"';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
|
|
|
|
+ * and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
|
|
|
|
+ * This method will test, if you need to disable this parameter via setting extra environment variable in your system.
|
|
|
|
+ *
|
|
|
|
+ * @return bool|string
|
|
|
|
+ */
|
|
|
|
+ private function checkHttpsProxyFullUriRequestParam()
|
|
|
|
+ {
|
|
|
|
+ if (!extension_loaded('openssl')) {
|
|
|
|
+ return 'You need the openssl extension installed for this check';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $url = 'https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0';
|
|
|
|
+ try {
|
|
|
|
+ $rfcResult = $this->rfs->getContents('api.github.com', $url, false);
|
|
|
|
+ } catch (TransportException $e) {
|
|
try {
|
|
try {
|
|
$this->rfs->getContents('api.github.com', $url, false, array('http' => array('request_fulluri' => false)));
|
|
$this->rfs->getContents('api.github.com', $url, false, array('http' => array('request_fulluri' => false)));
|
|
} catch (TransportException $e) {
|
|
} catch (TransportException $e) {
|
|
return 'Unable to assert the situation, maybe github is down ('.$e->getMessage().')';
|
|
return 'Unable to assert the situation, maybe github is down ('.$e->getMessage().')';
|
|
}
|
|
}
|
|
|
|
|
|
- return 'It seems there is a problem with your proxy server, try setting the "HTTP_PROXY_REQUEST_FULLURI" environment variable to "false"';
|
|
|
|
|
|
+ return 'It seems there is a problem with your proxy server, try setting the "HTTPS_PROXY_REQUEST_FULLURI" environment variable to "false"';
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
return true;
|