Config Overrides.

This function will merge with config overrides

@return void
481827
public function applyConfigOverrides()
    {
        // init
        $config_items = [];

        foreach ($this->settings_default as $key => $value) {
            if (ee()->config->item($key)) {
                $config_items[$key] = ee()->config->item($key);
            }
        }

        if (is_array($this->settings)) {
            $this->settings = array_merge($this->settings, $config_items);
        }
    }
1101666
protected function configure()
    {
        $this->setName('db:reset')
        ->setDescription('Resets all changes to database');

        // $this->_config = Config::getInstance('database');
        $this->_config = new Configuration();
        $this->_config = $this->_config->from('database');
    }
1013648
private final function loadConfig(): void
    {
        $this->config = new Config();

        $file = sprintf('%s/app/service/%s/config/config.php', APP_DIR, $this->name);
        if (file_exists($file) && is_array($data = include $file)) {
            $this->config->setData($data);
        }
    }
994538
protected function mergeConfigs()
    {
        $repo   = $this->getConfigRepository();
        $config = $repo->get(static::CONFIG_FILE_NAME_WO_EXT, []);
        $base   = $this->getBaseConfig();
        $result = $config + $base;
        $repo->set(static::CONFIG_FILE_NAME_WO_EXT, $result);
    }
792274
public function overrideMode($mode)
    {
        self::validateMode($mode);
        $this->mode = $mode;
        $this->overriddenMode = true;
    }
828398
public function set_config() {

		foreach ( $this->struct['config'] as $key => $setting ) {
			$this->attributes[ 'data-' . $key ] = $setting;
		}

	}
734235
def _merge_config(self, config_override):
        
        if not isinstance(config_override, dict):
            raise TypeError("config override must be a dict")

        def recursion(config_value, override_value):
            for key, value in override_value.items():
                if key in config_value:
                    if isinstance(value, dict) and isinstance(config_value[key], dict):
                        recursion(config_value[key], value)
                    else:
                        config_value[key] = value
                else:
                    config_value[key] = value

        for key, value in config_override.items():
            if key in self._data:
                recursion(self._data[key], value)
            else:
                self._data[key] = value
570902
protected function initConfig()
    {
        if (isset($this->settings) || $this->settings->exists('config')) {
            $this->config->setDefinition($this->settings->get('config'));
        }
    }
170447
public function config() {
        $config = Configure::read();
        unset($config['debug']);
        ksort($config);

        $this->set('configuration', $config);
    }
1002171
public function merge($config)
    {
        // override defaults with given config
        if (!empty($config['extra']['helhum/typo3-console']) && is_array($config['extra']['helhum/typo3-console'])) {
            foreach ($config['extra']['helhum/typo3-console'] as $key => $val) {
                $this->config[$key] = $val;
            }
        }
    }
520355
private static void applyOverrides() {
        // Get the appropriate InputStream to read overrides from, if any.
        InputStream stream = getContentTypesPropertiesStream();
        if (stream == null) {
            return;
        }

        try {
            try {
                // Read the properties file...
                Properties overrides = new Properties();
                overrides.load(stream);
                // And translate its mapping to ours...
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    String extension = (String) entry.getKey();
                    String mimeType = (String) entry.getValue();
                    add(mimeType, extension);
                }
            } finally {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
1073639
protected function registerConfigFiles()
    {
        if (isset($this->dir) and isset($this->configFiles) and is_array($this->configFiles)) {
            foreach ($this->configFiles as $key) {
                $path = $this->getConfigFilePath($key);
                //$this->mergeConfigFrom($this->getConfigFilePath($filename), $filename);
                $config = $this->app->make('config')->get($key, [ ]);
                $this->app->make('config')->set($key, array_replace_recursive(require $path, $config));
            }
        }
    }
135249
function overrideConfig( path, value ) {
      beforeAll( () => {
         configurationOverrides[ path ] = value;
      } );
      afterAll( () => {
         delete configurationOverrides[ path ];
      } );
   }
993660
public function cleanConfig()
    {
        // Revert config that was changed.
        foreach ($this->config as $name => $key_value) {
            foreach ($key_value as $key => $value) {
                $this->getDriver()->configSet($name, $key, $value);
            }
        }
        $this->config = array();
    }
573934
public function registerConfigData()
    {
        $authConfig = $this->app['config']->get('auth', []);

        $this->app['config']->set('auth', array_merge_recursive(require __DIR__ . '/../config/avored-auth.php', $authConfig));
        $this->mergeConfigFrom(__DIR__ . '/../config/avored-ecommerce.php', 'avored-ecommerce');
    }
424189
public function merge()
    {
        $marged = NULL;
        foreach (func_get_args() as $arg) {
            // first is override.
            if ($marged === null) {
                $marged = $arg;

            // when mismatch variable type, then override.
            } elseif (gettype($marged) !== gettype($arg)) {
                $marged = $arg;

            // when not array, then override.
            } elseif (! is_array($arg)) {
                $marged = $arg;

            // when both array, then merge recursive.
            } else {
                foreach ($arg as $_key => $_val) {
                    // when int key, then push.
                    if(is_int($_key)) {
                        $marged[] = $_val;
                    // when not exists key, then override.
                    } elseif(! isset($marged[$_key])) {
                        $marged[$_key] = $_val;
                    // merge.
                    } else {
                        $marged[$_key] = $this->merge($marged[$_key], $_val);
                    }
                }
            }
        }
        return $marged;
    }
966447
private function initializeTypes()
    {
        foreach ($this->typesConfig as $typeName => $typeConfig) {
            if (Type::hasType($typeName)) {
                Type::overrideType($typeName, $typeConfig['class']);
            } else {
                Type::addType($typeName, $typeConfig['class']);
            }
        }

        $this->initialized = true;
    }