1
0
Fork 0

Move config check after config read

pull/7835/head
bugreportuser 2018-12-13 12:15:45 -06:00
parent 02ee50ac1d
commit 767462b409
1 changed files with 10 additions and 10 deletions

View File

@ -164,6 +164,16 @@ class Factory
'data-dir' => self::getDataDir($home), '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'); $htaccessProtect = (bool) $config->get('htaccess-protect');
if ($htaccessProtect) { if ($htaccessProtect) {
// Protect directory against web access. Since HOME could be // 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 // load global auth file
$file = new JsonFile($config->get('home').'/auth.json'); $file = new JsonFile($config->get('home').'/auth.json');
if ($file->exists()) { if ($file->exists()) {