Expand cli TLS options to other commands + misc fixes
parent
bf01a55e53
commit
d8cbd9f057
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue