From cb32c480be2ea96df1fad5e3096e0b63fdae7255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draic=20Brady?= Date: Fri, 28 Feb 2014 20:40:57 +0000 Subject: [PATCH] Validate disable-tls and cafile config file values --- src/Composer/Command/ConfigCommand.php | 5 +++++ src/Composer/Config.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 48647512f..f9931ffa8 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/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( diff --git a/src/Composer/Config.php b/src/Composer/Config.php index fa151f8d4..722bc5370 100644 --- a/src/Composer/Config.php +++ b/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(