Consolidation\Cgr\Application::overlayEnvironmentValues PHP Method

overlayEnvironmentValues() protected method

Replace option default values with the corresponding environment variable value, if it is set.
protected overlayEnvironmentValues ( $defaults )
    protected function overlayEnvironmentValues($defaults)
    {
        foreach ($defaults as $key => $value) {
            $envKey = 'CGR_' . strtoupper(strtr($key, '-', '_'));
            $envValue = getenv($envKey);
            if ($envValue) {
                $defaults[$key] = $envValue;
            }
        }
        return $defaults;
    }