diff --git a/src/Settings.php b/src/Settings.php index c1cd56a..be1c780 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -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)