public
    static function mergeSettings(
        $generalSettings,
        $environmentSettings
    ) {
        $mergedSettings = $generalSettings;

        foreach ($environmentSettings as $key => &$value) {
            if (
                is_array($value)
                && isset($mergedSettings[$key])
                && is_array($mergedSettings [$key])
            ) {
                $mergedSettings[$key] = self::mergeSettings($mergedSettings[$key], $value);
            } else {
                $mergedSettings[$key] = $value;
            }
        }

        return $mergedSettings;
    }
public
    static function mergeSettings(
        $generalSettings,
        $environmentSettings
    ) {
        $mergedSettings = $generalSettings;

        foreach ($environmentSettings as $key => &$value) {
            if (
                is_array($value)
                && isset($mergedSettings[$key])
                && is_array($mergedSettings [$key])
            ) {
                $mergedSettings[$key] = self::mergeSettings($mergedSettings[$key], $value);
            } else {
                $mergedSettings[$key] = $value;
            }
        }

        return $mergedSettings;
    }
public static function mergeSettings ( $ generalSettings , $ environmentSettings ) { $ mergedSettings = $ generalSettings ; foreach ( $ environmentSettings as $ key => & $ value ) { if ( is_array ( $ value ) && isset ( $ mergedSettings [ $ key ] ) && is_array ( $ mergedSettings [ $ key ] ) ) { $ mergedSettings [ $ key ] = self :: mergeSettings ( $ mergedSettings [ $ key ] , $ value ) ; } else { $ mergedSettings [ $ key ] = $ value ; } } return $ mergedSettings ; }
Merges two arrays, just like array_merge_recursive, but the second array
overwrites the first one's values if there is a match.

@param array $generalSettings the base array
@param array $environmentSettings the overwriting array
@return array the merged settings.
Merges two arrays just like array_merge_recursive but the second array overwrites the first one s values if there is a match .