Fix missing opts for diagnose command

main
Pádraic Brady 11 years ago
parent 6c7dd39837
commit 825b458593

@ -24,6 +24,7 @@ use Composer\Util\RemoteFilesystem;
use Composer\Util\StreamContextFactory;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
/**
* @author Jordi Boggiano <j.boggiano@seld.be>
@ -43,7 +44,10 @@ class DiagnoseCommand extends Command
The <info>diagnose</info> command checks common errors to help debugging problems.
EOT
)
)->setDefinition(array(
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'),
))
;
}
@ -151,12 +155,8 @@ EOT
$result[] = '<error>Composer is configured to use SSL/TLS protection but the openssl extension is not available.</error>';
}
$rfsOptions = array();
if (!$disableTls && !is_null($config->get('cafile'))) {
$rfsOptions = array('ssl'=>array('cafile'=>$config->get('cafile')));
}
try {
$this->rfs = new RemoteFilesystem($this->getIO(), $rfsOptions, $disableTls);
$this->rfs = Factory::createRemoteFilesystem($this->getIO(), $config);
} catch (TransportException $e) {
if (preg_match('|cafile|', $e->getMessage())) {
$result[] = '<error>[' . get_class($e) . '] ' . $e->getMessage() . '</error>';

Loading…
Cancel
Save