From 2739fc05e9c40e7bae15fc40b229890db086ea3e Mon Sep 17 00:00:00 2001 From: bugreportuser <37939393+bugreportuser@users.noreply.github.com> Date: Thu, 13 Dec 2018 12:22:31 -0600 Subject: [PATCH] Read htaccess-protect as a bool --- src/Composer/Config.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 7b4220724..ad820ce3a 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -216,7 +216,6 @@ class Config case 'cache-vcs-dir': case 'cafile': case 'capath': - case 'htaccess-protect': // convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_')); @@ -230,6 +229,13 @@ class Config return (($flags & self::RELATIVE_PATHS) == self::RELATIVE_PATHS) ? $val : $this->realpath($val); + case 'htaccess-protect': + $value = $this->getComposerEnv('COMPOSER_HTACCESS_PROTECT'); + if (false === $value) { + $value = $this->config[$key]; + } + return $value !== 'false' && (bool) $value; + case 'cache-ttl': return (int) $this->config[$key];