From 767462b4095d655145c8e71f801c9f2c6f9ad9b3 Mon Sep 17 00:00:00 2001 From: bugreportuser <37939393+bugreportuser@users.noreply.github.com> Date: Thu, 13 Dec 2018 12:15:45 -0600 Subject: [PATCH] Move config check after config read --- src/Composer/Factory.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 1aac934a1..6df73ceb3 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -164,6 +164,16 @@ class Factory 'data-dir' => self::getDataDir($home), ))); + // load global config + $file = new JsonFile($config->get('home').'/config.json'); + if ($file->exists()) { + if ($io && $io->isDebug()) { + $io->writeError('Loading config file ' . $file->getPath()); + } + $config->merge($file->read()); + } + $config->setConfigSource(new JsonConfigSource($file)); + $htaccessProtect = (bool) $config->get('htaccess-protect'); if ($htaccessProtect) { // Protect directory against web access. Since HOME could be @@ -180,16 +190,6 @@ class Factory } } - // load global config - $file = new JsonFile($config->get('home').'/config.json'); - if ($file->exists()) { - if ($io && $io->isDebug()) { - $io->writeError('Loading config file ' . $file->getPath()); - } - $config->merge($file->read()); - } - $config->setConfigSource(new JsonConfigSource($file)); - // load global auth file $file = new JsonFile($config->get('home').'/auth.json'); if ($file->exists()) {