Make selfupdate use ssl when possible
parent
d4fb7bd251
commit
2e12993c9c
|
@ -41,13 +41,14 @@ EOT
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
$protocol = extension_loaded('openssl') ? 'https' : 'http';
|
||||||
$rfs = new RemoteFilesystem($this->getIO());
|
$rfs = new RemoteFilesystem($this->getIO());
|
||||||
$latest = trim($rfs->getContents('getcomposer.org', 'http://getcomposer.org/version', false));
|
$latest = trim($rfs->getContents('getcomposer.org', $protocol . '://getcomposer.org/version', false));
|
||||||
|
|
||||||
if (Composer::VERSION !== $latest) {
|
if (Composer::VERSION !== $latest) {
|
||||||
$output->writeln(sprintf("Updating to version <info>%s</info>.", $latest));
|
$output->writeln(sprintf("Updating to version <info>%s</info>.", $latest));
|
||||||
|
|
||||||
$remoteFilename = 'http://getcomposer.org/composer.phar';
|
$remoteFilename = $protocol . '://getcomposer.org/composer.phar';
|
||||||
$localFilename = $_SERVER['argv'][0];
|
$localFilename = $_SERVER['argv'][0];
|
||||||
$tempFilename = basename($localFilename, '.phar').'-temp.phar';
|
$tempFilename = basename($localFilename, '.phar').'-temp.phar';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue