Procházet zdrojové kódy

Validate disable-tls and cafile config file values

Pádraic Brady před 11 roky
rodič
revize
cb32c480be

+ 5 - 0
src/Composer/Command/ConfigCommand.php

@@ -285,6 +285,11 @@ EOT
             'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }),
             'optimize-autoloader' => array($booleanValidator, $booleanNormalizer),
             'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),
+            'disable-tls' => array($booleanValidator, $booleanNormalizer),
+            'cafile' => array(
+                function ($val) { return file_exists($val) && is_readable($val); }
+                function ($val) { return $val; }
+            )
         );
         $multiConfigValues = array(
             'github-protocols' => array(

+ 2 - 1
src/Composer/Config.php

@@ -39,7 +39,8 @@ class Config
         'optimize-autoloader' => false,
         'prepend-autoloader' => true,
         'github-domains' => array('github.com'),
-        'disable-tls' => false
+        'disable-tls' => false,
+        'cafile' => null,
     );
 
     public static $defaultRepositories = array(