Add http check even if openssl is present, refs #4084
parent
24168d9d5c
commit
6d15ad08b6
|
@ -81,8 +81,11 @@ EOT
|
||||||
$this->getIO()->write('Checking git settings: ', false);
|
$this->getIO()->write('Checking git settings: ', false);
|
||||||
$this->outputResult($this->checkGit());
|
$this->outputResult($this->checkGit());
|
||||||
|
|
||||||
$this->getIO()->write('Checking http connectivity: ', false);
|
$this->getIO()->write('Checking http connectivity to packagist: ', false);
|
||||||
$this->outputResult($this->checkHttp());
|
$this->outputResult($this->checkHttp('http'));
|
||||||
|
|
||||||
|
$this->getIO()->write('Checking https connectivity to packagist: ', false);
|
||||||
|
$this->outputResult($this->checkHttp('https'));
|
||||||
|
|
||||||
$opts = stream_context_get_options(StreamContextFactory::getContext('http://example.org'));
|
$opts = stream_context_get_options(StreamContextFactory::getContext('http://example.org'));
|
||||||
if (!empty($opts['http']['proxy'])) {
|
if (!empty($opts['http']['proxy'])) {
|
||||||
|
@ -168,11 +171,10 @@ EOT
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkHttp()
|
private function checkHttp($proto)
|
||||||
{
|
{
|
||||||
$protocol = extension_loaded('openssl') ? 'https' : 'http';
|
|
||||||
try {
|
try {
|
||||||
$this->rfs->getContents('packagist.org', $protocol . '://packagist.org/packages.json', false);
|
$this->rfs->getContents('packagist.org', $proto . '://packagist.org/packages.json', false);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $e;
|
return $e;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue