make modes configurable in default.conf.php

relates #5453
This commit is contained in:
norb 2021-07-01 22:48:41 +02:00
parent 9457987a31
commit d90a9880db
1 changed files with 7 additions and 2 deletions

View File

@ -142,6 +142,10 @@ class Settings implements \Iterator
throw new \Exception( "No settingsfile: $defaultConf" );
// throw new FileNotFoundException();
}
if (isset($this->settings['modes'])) {
$this->addModes($this->settings['modes']);
}
// load local config without merging - we need it here for the mode
$conf = $this->buildFileName();
@ -167,9 +171,9 @@ class Settings implements \Iterator
}
// load and merge Prefix.mode.conf.php
if ( isset( $modes[ $this->mode ] ) )
if ( isset( $this->modes[ $this->mode ] ) )
{
$modeConf = $this->buildFileName( $modes[ $this->mode ] );
$modeConf = $this->buildFileName( $this->modes[ $this->mode ] );
if ( file_exists($modeConf) )
{
@ -183,6 +187,7 @@ class Settings implements \Iterator
else
{
// log invalid mode
throw new \Exception( "The mode '{$this->mode}' is not valid" );
}
// merge Prefix.conf.php (localConf)