@param $config

@throws RedisMalformedConfigException
322728
private function setConfig($config)
    {
        $allowedConfigKeys = [
            'alias',
            'async',
            'database',
            'host',
            'iterable_multibulk',
            'options',
            'password',
            'path',
            'port',
            'persistent',
            'profile',
            'timeout',
            'read_write_timeout',
            'scheme',
            'throw_errors',
            'weight',
        ];

        foreach ($config as $param => $server) {
            if (is_array($server)) {
                foreach (array_keys($server) as $key) {
                    if (!in_array($key, $allowedConfigKeys)) {
                        throw new RedisMalformedConfigException();
                    }
                }
            }

            if (!is_array($server) && !in_array($param, $allowedConfigKeys)) {
                throw new RedisMalformedConfigException();
            }
        }

        $this->config = $config;
    }
212565
public function manipulate(Config $config)
    {
        if ($this->isArrayAppend) {
            $this->appendToArraySetting($config);
        } else {
            $this->setSingleConfigValue($config);
        }
    }
921684
public static function setConfig($config)
	{
		//set the error file path
		self::$errorFilePath = dirname(dirname(__FILE__)) . '/Exceptions/';

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

	}
266755
public function run($config = null) {
		if ($config !== null) $this->setEnvConfig($config);
		Swoole::start();
	}
16141
protected function _setup($config) {
        if (!empty($config['url'])) {
            $this->_url = $config['url'];
        }
        if (!empty($config['params'])) {
            $this->_params = $config['params'];
        }
    }
666661
public function load(array $config, ContainerBuilder $container)
    {
        $config = $this->processConfiguration(new Configuration(), $config);

        $provider = $config['provider'];
        $container->setParameter(
            'openclassrooms.cache.default_lifetime',
            $config['default_lifetime']
        );

        $container->setParameter(
            'openclassrooms.cache.cache_provider_type',
            key($provider)
        );

        switch (key($provider)) {
            case CacheProviderType::REDIS:
                $providerConfig = $provider[CacheProviderType::REDIS];
                $container->setParameter('openclassrooms.cache.provider_host', $providerConfig['host']);
                $container->setParameter('openclassrooms.cache.provider_port', $providerConfig['port']);
                $container->setParameter('openclassrooms.cache.provider_timeout', $providerConfig['timeout']);
                break;
            default;
                break;
        }

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/'));
        $loader->load('services.xml');
    }
420484
public function init( $config = [ ] )
    {
        foreach ( $config as $key => $value )
        {
            switch ( $key )
            {
                case 'level':
                    $this->_level = ( int ) $value;
                    break;

                case 'mailer':
                    $this->_mailer = $value;
                    break;

                case 'formatter':
                    $this->_formatter = new $value();
                    break;

                default:
                    // do nothing
                    break;
            }
        }
    }
712443
public static function setConfiguration($config)
	{
		if(!is_array($config))
			throw new ConfigurationException('Configuration needs to be an array');
		
		if(array_key_exists('primaryGSLSNode')) self::$primaryGSLSNode = $config['primaryGSLSNode'];
		if(array_key_exists('secondaryGSLSNode')) self::$secondaryGSLSNode = $config['secondaryGSLSNode'];
		
		if(array_key_exists('apiPath')) self::$apiPath = $config['apiPath'];
		if(array_key_exists('timezone')) self::$timezone = $config['timezone'];
		if(array_key_exists('verbose')) self::$verbose = $config['verbose'];
		if(array_key_exists('curlVerbose')) self::$curlVerbose = $config['curlVerbose'];
		if(array_key_exists('requestTimeout')) self::$requestTimeout = $config['requestTimeout'];
		if(array_key_exists('gslsTimeout')) self::$gslsTimeout = $config['gslsTimeout'];
		if(array_key_exists('logfile')) self::$logfile = $config['logfile'];
	}
645982
private function doApplicationConfigExtend(Config $config)
    {
        $config_directories = ConfigDirectory::getDirectories(
            null,
            $this->baseRepository,
            $this->context,
            $this->environment
        );

        foreach ($config_directories as $directory) {
            if (is_dir($directory)) {
                $config->extend($directory, $this->overrideConfig);
            }
        }
    }
131933
public function initialize(array $config)
    {
        parent::initialize($config);

        $_config = [
            'context'  => __d('core', 'record'),
            'redirect' => [
                'action'     => 'index',
                'prefix'     => $this->_request->getParam('prefix'),
                'plugin'     => $this->_request->getParam('plugin'),
                'controller' => $this->_request->getParam('controller'),
            ],
            'messages' => [
                'no_action' => __d('core', 'Action not found.'),
                'no_choose' => __d('core', 'Please choose only one item.'),
            ]
        ];

        $config = Hash::merge($_config, $config);
        $this->setConfig($config);
    }
992429
public function setConfig($config)
    {
        if(is_string($config)){
            if (file_exists($config)) {
                $config = \Zend\Config\Factory::fromFile($config);
            } else {
                throw new \InvalidArgumentException(
                    sprintf('Unable to read configurations from file %s',$config));
            }
        }
    
        if(!is_array($config) && !($config instanceof \Traversable)){
            throw new \InvalidArgumentException(
                    sprintf('Config must be an array, Traversable object or filename; %s received',
                            is_object($config) ? get_class($config) : gettype($config)));
        }
    
        $this->setOptions($config);
    }
1001720
public function configure( Config $config )
    {
        parent::configure($config);

        $this->_field_order    = $this->processMacro($config->getList('field_order', []));
        $this->_delimiter      = $this->processMacro($config->getInteger('delimiter', 0));
        $this->_double_quoted  = $this->processMacro($config->getBoolean('double_quoted', false));
        $this->_eol_code       = $this->processMacro($config->getInteger('eol_code', 0));
    }
332129
protected function applyPermissions(array $config) : void
    {
        $this->stdout("Init permissions: " . count($config) . "\n", Console::FG_YELLOW);
        foreach ($config as $item) {
            if ($permission = $this->applyPermission($item)) {
                $this->stdout("\t- success: " . $permission->name . "\n", Console::FG_GREEN);
            } else {
                $this->stdout("\t- error config permission: " . Json::encode($item) . "\n", Console::FG_RED);
            }
        }
    }
1067897
public function setConfig(Config $config)
    {
        $this->checkConfigConsistency($config);

        $this->config = $config;

        return $this;
    }
1211558
private function validateBooleans($config): void
    {
        // Check boolean parameters
        if (! Validator::key('overwrite', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"overwrite" parameter must be set as a boolean.');
        }
        if (! Validator::key('backup', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"backup" parameter must be set as a boolean.');
        }
        if (! Validator::key('ignore', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"ignore" parameter must be set as a boolean.');
        }
    }
318182
protected function applyAssignConfig(array $config) : void
    {
        $this->assignRoles(ArrayHelper::get($config, 'roles', []));
        $this->assignPermissions(ArrayHelper::get($config, 'permissions', []));
    }
1366400
public function setAll($config): void
    {
        foreach ($config as $id => $definition) {
            $this->set($id, $definition);
        }
    }