From 6ce11697ecc83ce67af91f50134c542b6c294d6c Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Fri, 13 Oct 2017 22:38:35 -0600 Subject: [PATCH] Load default config in with other configs --- src/Composer/Factory.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 23eaaab09..fe5102b81 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -200,6 +200,16 @@ class Factory } $config->setAuthConfigSource(new JsonConfigSource($file, true)); + // load global auth file + $file = new JsonFile($config->get('home').'/defaults.json'); + if ($file->exists()) { + if ($io && $io->isDebug()) { + $io->writeError('Loading config file ' . $file->getPath()); + } + $config->merge(array('config' => $file->read())); + } + $config->setDefaultsConfigSource(new JsonConfigSource($file, true)); + // load COMPOSER_AUTH environment variable if set if ($composerAuthEnv = getenv('COMPOSER_AUTH')) { $authData = json_decode($composerAuthEnv, true);