Add warning/info msg when tweaking disable-tls setting to avoid confusion, fixes #7935
parent
e05fa2368f
commit
19ba2edd5c
|
@ -456,6 +456,10 @@ EOT
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($input->getOption('unset') && (isset($uniqueConfigValues[$settingKey]) || isset($multiConfigValues[$settingKey]))) {
|
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);
|
return $this->configSource->removeConfigSetting($settingKey);
|
||||||
}
|
}
|
||||||
if (isset($uniqueConfigValues[$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)
|
protected function handleMultiValue($key, array $callbacks, array $values, $method)
|
||||||
|
|
Loading…
Reference in New Issue