|
|
|
@ -229,6 +229,27 @@ class Runtime
|
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shortcut to get the the configuration option for a specific environment and merge it with |
|
|
|
|
* the global one (environment specific overrides the global one if present). |
|
|
|
|
* |
|
|
|
|
* @param $key |
|
|
|
|
* @param null $defaultEnv |
|
|
|
|
* @param null $defaultConfig |
|
|
|
|
* |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|
public function getMergedEnvAndConfigOption($key, $defaultEnv = null, $defaultConfig = null) |
|
|
|
|
{ |
|
|
|
|
$userGlobalOptions = $this->getConfigOption($key, $defaultConfig); |
|
|
|
|
$userEnvOptions = $this->getEnvOption($key, $defaultEnv); |
|
|
|
|
|
|
|
|
|
return array_merge( |
|
|
|
|
(is_array($userGlobalOptions) ? $userGlobalOptions : []), |
|
|
|
|
(is_array($userEnvOptions) ? $userEnvOptions : []) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Overwrites an Environment Configuration Option |
|
|
|
|
* |
|
|
|
|