1
0
Fork 0

Expand cli TLS options to other commands + misc fixes

pull/2745/head
Pádraic Brady 2014-02-28 20:35:08 +00:00
parent bf01a55e53
commit d8cbd9f057
8 changed files with 14 additions and 8 deletions

View File

@ -69,6 +69,8 @@ class CreateProjectCommand extends Command
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deletion vcs folder.'),
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
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'),
))
->setHelp(<<<EOT
The <info>create-project</info> command creates a new project from a given

View File

@ -152,10 +152,8 @@ EOT
}
$rfsOptions = array();
if ($disableTls) {
if (!is_null($config->get('cafile'))) {
if (!$disableTls && !is_null($config->get('cafile'))) {
$rfsOptions = array('ssl'=>array('cafile'=>$config->get('cafile')));
}
}
try {
$this->rfs = new RemoteFilesystem($this->getIO(), $rfsOptions, $disableTls);

View File

@ -45,6 +45,8 @@ class InstallCommand extends Command
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
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('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Should not be provided, use composer require instead to add a given package to composer.json.'),
))
->setHelp(<<<EOT

View File

@ -41,6 +41,8 @@ class SearchCommand extends Command
->setDescription('Search for packages')
->setDefinition(array(
new InputOption('only-name', 'N', InputOption::VALUE_NONE, 'Search only in name'),
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('tokens', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'tokens to search for'),
))
->setHelp(<<<EOT

View File

@ -77,7 +77,7 @@ EOT
$remoteFilesystemOptions = array();
if ($disableTls === false) {
if (!is_null($config->get('cafile'))) {
$remoteFilesystemOptions = array('ssl'=>array('cafile'=>$config->get('cafile')));
$remoteFilesystemOptions = array('ssl'=>array('cafile'=>$config->get('cafile')));
}
if (!is_null($input->getOption('cafile'))) {
$remoteFilesystemOptions = array('ssl'=>array('cafile'=>$input->getOption('cafile')));

View File

@ -50,6 +50,8 @@ class ShowCommand extends Command
new InputOption('available', 'a', InputOption::VALUE_NONE, 'List available packages only'),
new InputOption('self', 's', InputOption::VALUE_NONE, 'Show the root package information'),
new InputOption('name-only', 'N', InputOption::VALUE_NONE, 'List package names only'),
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'),
))
->setHelp(<<<EOT
The show command displays detailed information about a package, or

View File

@ -45,7 +45,9 @@ class UpdateCommand extends Command
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'),
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.')
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'),
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'),
))
->setHelp(<<<EOT
The <info>update</info> command reads the composer.json file from the

View File

@ -207,10 +207,8 @@ class Factory
}
$rfsOptions = array();
if ($disableTls === false) {
if (!is_null($input->getOption('cafile'))) {
if ($disableTls === false && !is_null($input->getOption('cafile'))) {
$rfsOptions = array('ssl'=>array('cafile'=>$input->getOption('cafile')));
}
}
$rfs = new RemoteFilesystem($io, $rfsOptions, $disableTls);
}