Browse Source

Fix missing opts for diagnose command

Pádraic Brady 11 years ago
parent
commit
825b458593
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/Composer/Command/DiagnoseCommand.php

+ 6 - 6
src/Composer/Command/DiagnoseCommand.php

@@ -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>';