implement tests for site specific config

test that site directory config files are read correctly
correct Settings.php to pass tests
This commit is contained in:
norb 2021-01-11 16:38:35 +01:00
commit c2b13b2f86
4 changed files with 27 additions and 14 deletions

View file

@ -146,15 +146,6 @@ class Settings implements \Iterator
$localConf = false;
if (file_exists($conf)) $localConf = require($conf);
if ( isset($this->site) )
{
$siteConf = $this->buildFileName(self::SITE);
if (file_exists($siteConf))
{
$localConf = array_replace_recursive($localConf, require($siteConf));
}
}
if (! isset($this->mode))
{ // if a localConf Mode is set use it, or take the default conf mode
$this->mode = (isset($localConf['mode'])) ? $localConf['mode'] : $this->settings['mode'];
@ -164,6 +155,15 @@ class Settings implements \Iterator
$this->settings['mode'] = $this->mode;
}
if ( isset($this->site) )
{
$siteConf = $this->buildFileName(self::SITE);
if (file_exists($siteConf))
{
$localConf = array_replace_recursive($this->settings, require($siteConf));
}
}
// load and merge Prefix.mode.conf.php
if ( isset( $modes[ $this->mode ] ) )
{