allow better standard config
This commit is contained in:
@@ -60,16 +60,17 @@ class Configuration {
|
||||
// by default, set the session save path to the default value;
|
||||
$this->values['session']['save_path'] = session_save_path();
|
||||
|
||||
if(file_exists($this->custom_config)) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once($this->custom_config);
|
||||
|
||||
if(! isset($configuration) || ! is_array($configuration)) {
|
||||
throw new \RuntimeException("You custom configuration in '{$this->custom_config}' must be in a variable named '\$configuration' and be an array.");
|
||||
}
|
||||
|
||||
$this->values = array_replace_recursive($this->values, $configuration);
|
||||
if(!file_exists($this->custom_config)) {
|
||||
throw new \Exception\UsageException('No configuration.local.php file was found. Create it with the proper config.');
|
||||
}
|
||||
|
||||
$configuration = include_once $this->custom_config;
|
||||
|
||||
if(!is_array($configuration)) {
|
||||
throw new \RuntimeException("You custom configuration in '{$this->custom_config}' must be in a variable named '\$configuration' and be an array.");
|
||||
}
|
||||
|
||||
$this->values = array_replace_recursive($this->values, $configuration);
|
||||
}
|
||||
|
||||
private function dotNotationAccess($data, $key, $default=null)
|
||||
|
||||
Reference in New Issue
Block a user