Extract the processors from the given configuration.

@param array $config
@return array
337760
protected function parseProcessors(array $config): array
    {
        $processors = [];

        if (isset($config['processors']) && is_array($config['processors'])) {
            foreach ($config['processors'] as $processor) {
                $processors[] = $processor;
            }
        }

        return $processors;
    }
136957
public function loadFromArray(array $config)
    {
        if (isset($config['domains'])) {
            $this->loadDomainConfiguration($config);
        }

        if (isset($config['general'])) {
            $general = $config['general'];
            $generalConfig = $this->getParsedConfig(
                $general,
                $this->config,
                $this->yamlConfigMap,
                []
            );
            $this->setCache(CacheFactory::get($generalConfig['cacheType'], $generalConfig['cacheOptions']));
            unset($generalConfig['cacheType']);
            unset($generalConfig['cacheOptions']);
            $this->setParsedConfig($generalConfig);
        }

        return $this;
    }
1158155
protected function getClient(array $config)
    {
        $name = array_get($config, 'connector');

        return $this->cache->driver($name)->getStore();
    }
499506
protected function getTargets(array $config)
    {
        if (!isset($config['targets'])
            || !is_array($config['targets'])
            || array_filter($config['targets'], 'is_array') != $config['targets']) {
            throw new \DomainException(
                'targets must be an array of arrays',
                self::ERR_TARGETS_INVALID
            );
        }
        return $config['targets'];
    }
166839
static public function config($config = array())
    {
        !empty($config) && self::$config = array_merge(self::$config, $config);
        if (!empty(self::$config['cachepath'])) {
            Cache::$cachepath = self::$config['cachepath'];
        }
        if (empty(self::$config['component_verify_ticket'])) {
            self::$config['component_verify_ticket'] = Cache::get('component_verify_ticket');
        }
        if (empty(self::$config['token']) && !empty(self::$config['component_token'])) {
            self::$config['token'] = self::$config['component_token'];
        }
        if (empty(self::$config['appsecret']) && !empty(self::$config['component_appsecret'])) {
            self::$config['appsecret'] = self::$config['component_appsecret'];
        }
        if (empty(self::$config['encodingaeskey']) && !empty(self::$config['component_encodingaeskey'])) {
            self::$config['encodingaeskey'] = self::$config['component_encodingaeskey'];
        }
        return self::$config;
    }
1145643
private function getCacheInstance(array $config)
    {
        if (!isset($config['enable']) || !$config['enable']) {
            return null;
        }

        $className = $config['adapter'];
        if (!class_exists($className)) {
            $errMsg = sprintf('Adapter "%s" is not supported for caching', $config['adapter']);
            throw new Exception\RuntimeException($errMsg);
        }
        return new $className($config['options']);
    }
36038
private function getServiceParams(array $config)
    {
        return [
            'endpoint' => $this->getParamOrFail($config, 'endpoint'),
            'headers'  => $this->getParam($config, 'headers', []),
            'query'    => $this->getParam($config, 'query', []),
            'body'     => $this->getParam($config, 'body', []),
            'version'  => $this->getParam($config, 'version', '1.1'),
            'retries'  => $this->getParam($config, 'retries', 0),
            'options'  => $this->getParam($config, 'options', []),
        ];
    }
1159831
protected function getReadConfig( array $config )
	{
		$readConfig = $this->getReadWriteConfig( $config, 'read' );

		if ( isset( $readConfig['host'] ) && is_array( $readConfig['host'] ) )
			$readConfig['host'] = count( $readConfig['host'] ) > 1 ? $readConfig['host'][array_rand( $readConfig['host'] )] : $readConfig['host'][0];

		return $this->mergeReadWriteConfig( $config, $readConfig );
	}
1234267
protected function getConnections(array $config)
    {
        if (!isset($config['connections'])) {
            throw new \RuntimeException('Configuration must contain a "connections" key');
        }

        if (!is_array($config['connections']) || !$config['connections']) {
            throw new \RuntimeException('Configuration "connections" key must reference a non-empty array');
        }

        $connections = array_filter(
            $config['connections'],
            function ($connection) {
                return $connection instanceof ConnectionInterface;
            }
        );
        if (count($connections) != count($config['connections'])) {
            throw new \RuntimeException(
                'All configuration "connections" array values must implement \Phergie\Irc\ConnectionInterface'
            );
        }

        return $connections;
    }
1037643
private function filter(array $config): array
    {
        $filteredConfig = $config;
        if (!empty($config['app_root'])) {
            $filteredConfig['app_root'] = rtrim($config['app_root'], '/');
        }

        if (!empty($config['relative_document_root'])) {
            $filteredConfig['relative_document_root'] = rtrim($config['relative_document_root'], '/');
        }

        if (!empty($config['default_file_mode'])) {
            if (is_string($config['default_file_mode'])) {
                $filteredConfig['default_file_mode'] = octdec($config['default_file_mode']);
            } else {
                $filteredConfig['default_file_mode'] = (int)$config['default_file_mode'];
            }
        }

        if (!empty($config['default_dir_mode'])) {
            if (is_string($config['default_dir_mode'])) {
                $filteredConfig['default_dir_mode'] = octdec($config['default_dir_mode']);
            } else {
                $filteredConfig['default_dir_mode'] = (int)$config['default_dir_mode'];
            }
        }
        return $filteredConfig;
    }
139414
protected function getPlugins(array $config)
    {
        if (!isset($config['plugins']) || !is_array($config['plugins'])) {
            throw new \RuntimeException(
                'Configuration must contain "plugins" key referencing an array',
                self::ERR_PLUGINS_NONARRAY
            );
        }

        $filtered = array_filter(
            $config['plugins'],
            function($plugin) {
                return !$plugin instanceof PluginInterface;
            }
        );
        if ($filtered) {
            throw new \RuntimeException(
                'Configuration "plugins" key must contain only objects'
                    . ' implementing \Phergie\Irc\Bot\React\PluginInterface',
                self::ERR_PLUGINS_NONPLUGINS
            );
        }

        return $config['plugins'];
    }
1258349
private function convertToArray(array $config)
    {
        foreach ($config as $key => &$value) {
            if (is_array($value)) {
                $value = $this->convertToArray($value);

                if (!$value) {
                    unset($config[$key]);
                }
            } elseif ($value instanceof IConfigValue) {
                if ($value->has(IConfigValue::KEY_LOCAL)) {
                    $value = $value->get(IConfigValue::KEY_LOCAL);
                } else {
                    unset($config[$key]);
                }
            } elseif ($value instanceof IConfigSource) {
                unset($config[$key]);
            } else {
                throw new UnexpectedValueException($this->translate(
                    'Config source is corrupted.'
                ));
            }
        }

        return $config;
    }
1018426
protected function getReadConfig(array $config)
    {
        $readConfig = $this->getReadWriteConfig($config, 'read');

        return $this->mergeReadWriteConfig($config, $readConfig);
    }
1362883
public static function config_get_configuration_array($data) {
        $return = array(
            'server' => $data->server,
            'database' => $data->database,
            'extendedmode' => (!empty($data->extendedmode))
        );
        if (!empty($data->username)) {
            $return['username'] = $data->username;
        }
        if (!empty($data->password)) {
            $return['password'] = $data->password;
        }
        if (!empty($data->replicaset)) {
            $return['replicaset'] = $data->replicaset;
        }
        if (!empty($data->usesafe)) {
            $return['usesafe'] = true;
            if (!empty($data->usesafevalue)) {
                $return['usesafe'] = (int)$data->usesafevalue;
                $return['usesafevalue'] = $return['usesafe'];
            }
        }
        return $return;
    }
574996
protected function convertScrapeConfig(array $config)
	{
		$config['extract'] = $this->convertRegexps($config['extract']);
		$config['match']   = $this->convertRegexps($config['match']);

		return $config;
	}
1097158
public function getOptions(array $config)
    {
        $options = array_get($config, 'options', array());

        return array_diff_key($this->options, $options) + $options;
    }
789337
protected function _prepareConnectionParams(array $config)
    {
        $params = [];
        $params['config'] = [];
        foreach ($config as $key => $value) {
            if (\in_array($key, ['bigintConversion', 'curl', 'headers', 'url'])) {
                $params['config'][$key] = $value;
            } else {
                $params[$key] = $value;
            }
        }

        return $params;
    }