1
0
Fork 0

Add warning/info msg when tweaking disable-tls setting to avoid confusion, fixes #7935

pull/7950/head
Jordi Boggiano 2019-01-30 08:58:38 +01:00
parent e05fa2368f
commit 19ba2edd5c
1 changed files with 15 additions and 1 deletions

View File

@ -456,6 +456,10 @@ EOT
);
if ($input->getOption('unset') && (isset($uniqueConfigValues[$settingKey]) || isset($multiConfigValues[$settingKey]))) {
if ($settingKey === 'disable-tls' && $this->config->get('disable-tls')) {
$this->getIO()->writeError('<info>You are now running Composer with SSL/TLS protection enabled.</info>');
}
return $this->configSource->removeConfigSetting($settingKey);
}
if (isset($uniqueConfigValues[$settingKey])) {
@ -640,7 +644,17 @@ EOT
));
}
return call_user_func(array($this->configSource, $method), $key, $normalizer($values[0]));
$normalizedValue = $normalizer($values[0]);
if ($key === 'disable-tls') {
if (!$normalizedValue && $this->config->get('disable-tls')) {
$this->getIO()->writeError('<info>You are now running Composer with SSL/TLS protection enabled.</info>');
} elseif ($normalizedValue && !$this->config->get('disable-tls')) {
$this->getIO()->writeError('<warning>You are now running Composer with SSL/TLS protection disabled.</warning>');
}
}
return call_user_func(array($this->configSource, $method), $key, $normalizedValue);
}
protected function handleMultiValue($key, array $callbacks, array $values, $method)