From 4d5515190fd3962b78b6fe2cca1630e1e5064e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draic=20Brady?= Date: Sun, 23 Feb 2014 12:48:17 +0000 Subject: [PATCH] Reorder self-update opts and correct requirements --- src/Composer/Command/SelfUpdateCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 51ab6aef9..c14c6bc43 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -42,8 +42,9 @@ class SelfUpdateCommand extends Command ->setDefinition(array( new InputOption('rollback', 'r', InputOption::VALUE_NONE, 'Revert to an older installation of composer'), new InputOption('clean-backups', null, InputOption::VALUE_NONE, 'Delete old backups during an update. This makes the current version of composer the only backup available after the update'), + new InputOption('disable-tls', null, InputOption::VALUE_NONE, 'Disable SSL/TLS protection for HTTPS requests'), + new InputOption('cafile', null, InputOption::VALUE_REQUIRED, 'The path to a valid CA certificate file for SSL/TLS certificate verification'), new InputArgument('version', InputArgument::OPTIONAL, 'The version to update to'), - new InputOption('disable-tls', null, InputArgument::VALUE_NONE, 'Disable SSL/TLS protection for HTTPS requests'), )) ->setHelp(<<self-update command checks getcomposer.org for newer @@ -75,6 +76,9 @@ EOT if (!is_null($config->get('cafile'))) { $remoteFilesystemOptions = array('ssl'=>array('cafile'=>$config->get('cafile'))); } + if (!is_null($input->get('cafile'))) { + $remoteFilesystemOptions = array('ssl'=>array('cafile'=>$input->get('cafile'))); + } $remoteFilesystem = new RemoteFilesystem($this->getIO(), $remoteFilesystemOptions); } catch (TransportException $e) { if (preg_match('|cafile|', $e->getMessage())) {