Add or update 'override_site' section to provided $config with difference between current config settings
and config default settings.

@param Config $config the config we want to add/update its 'override_site' section
505982
private function updateConfigOverridedSectionsForSite(Config $config)
    {
        if (false === $this->application->isStarted()) {
            throw new BBException('Application is not started, we are not able to persist multiple site config.');
        }

        $default_sections = $this->configurator->getConfigDefaultSections($config);
        $current_sections = $config->getAllRawSections();

        $sections_to_update = array_keys(Collection::array_diff_assoc_recursive($default_sections, $current_sections));
        $sections_to_update = array_unique(array_merge(
            $sections_to_update,
            array_keys(Collection::array_diff_assoc_recursive($current_sections, $default_sections))
        ));

        $override_site = $config->getRawSection('override_site') ?: array();
        $site_uid = $this->application->getSite()->getUid();
        if (false === array_key_exists($site_uid, $override_site)) {
            $override_site[$site_uid] = array();
        }

        $override_sections_site = &$override_site[$site_uid];

        foreach ($sections_to_update as $section) {
            if ('override_site' !== $section) {
                $override_sections_site[$section] = $config->getRawSection($section);
            }
        }

        $config->deleteAllSections();
        foreach ($this->configurator->getConfigDefaultSections($config) as $section_name => $section_settings) {
            $config->setSection($section_name, $section_settings);
        }

        $config->setSection('override_site', $override_site, true);
    }
244710
public function addRoot($domain, $config)
    {
	if (is_string($config)) {
            $config = array('root' => $config);
	}
        $this->serverRoot[$domain] = $config;
    }
1157288
private function checkConfigKeys($config)
    {
        $config = array_change_key_case($config, CASE_LOWER);
        $config = $this->trimArray($config);

        foreach ($config as $key => $value) {
            if (array_key_exists($key, $this->config)) {
                $this->config[$key] = $value;
            } else {
                throw new \Exception('Key ' . $key . ' is either not part of the configuration or has incorrect Key name.
                check the config array key names to match your key names of your config array', 1);
            }
        }
    }
508892
public function addConfig($config) {
        if (is_array($config)) {
            // array of paths to config files
            if (array_is_indexed($config)) {
                $this->addPaths($config);
            }
            // array of key value configs
            else {
                $this->addRuntimeConfig($config);
            }
        }
        // path to config file
        else if (is_string($config)) {
            $this->addPath($config);
        }
        // config object
        else if ($config instanceof IConfig) {
            $this->addRuntimeConfig($config);
        }

        return $this;
    }
942527
protected function setUpGeneralConfigurations(Configuration $config)
    {
        $this->setupAnnotationMetadata();
        $config->setMetadataDriverImpl($this->getMetadataMappingDriver());

        $config->setProxyDir($this->getProxiesPath());
        $config->setProxyNamespace($this->getProxiesNamespace());
        $config->setAutoGenerateProxyClasses($this->getProxiesAutoGeneration());

        $config->setMetadataCacheImpl($this->getMetadataCacheDriver());
    }
937300
private void overrideConfigFromFile(Configuration config) throws IOException {
    String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
    if (configFile != null) {
      config.addResource(new FileInputStream(configFile));
    }
  }
1024200
public function addConfig(ParametersConfig $config):void
    {
        array_unshift($this->configs, $config);
        foreach ($this->info->getNames() as $name) {
            if ($config->hasValue($name)) {
                $this->missingValues[$name] = false;
            }
        }
    }
1133971
private function configure(array $config = [])
    {
        foreach ($config as $property => $value) {
            if (property_exists($this, $property)) {
                $this->{$property} = $value;
            }
        }
    }
16141
protected function _setup($config) {
        if (!empty($config['url'])) {
            $this->_url = $config['url'];
        }
        if (!empty($config['params'])) {
            $this->_params = $config['params'];
        }
    }
1270458
protected function _setup($config) {
        $config = new Garp_Util_Configuration($config);
        $config->obligate('contentTypes');
        $this->_config = $config;
    }
231214
private function setConfig($config)
    {
        $allowedConfigKeys = [
            'host',
            'port',
            'sasl_user',
            'sasl_password',
        ];

        foreach ($config as $key => $server) {
            (false === is_array($server)) ? $this->checkSimpleConfigArray($key, $allowedConfigKeys) : $this->checkMultidimensionalConfigArray($server, $allowedConfigKeys);
        }

        $this->config = $config;
    }
821610
public function setConfiguration($config)
    {
        $this->config = $config;
        $encoded = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
        file_put_contents($this->appRoot . '/config.json', $encoded);
    }
951933
private function configure(array $config = []): void
    {
        foreach ($config as $param => $value) {
            $property = $this->toCamelCase($param);
            if (property_exists(self::class, $property)) {
                $this->$property = $value;
            }
        }
    }
1366400
public function setAll($config): void
    {
        foreach ($config as $id => $definition) {
            $this->set($id, $definition);
        }
    }
434524
protected function checkConfig(array $config): void
    {
        foreach (['host', 'username', 'password', 'database', 'persistent'] as $key) {
            if (!isset($config[$key])) {
                $class = get_class($this);
                throw new ConfigException("Missing configuration key={$key} in {$class}");
            }
        }
    }
921684
public static function setConfig($config)
	{
		//set the error file path
		self::$errorFilePath = dirname(dirname(__FILE__)) . '/Exceptions/';

		//set the config array
		self::$config = $config; 

	}
563414
public static function configure($config)
    {
        if (is_null(static::$instance)) {
            static::$instance = new self();

            static::$name = $config['default'];

            static::$config = $config;
        }

        return static::$instance;
    }