Add a configuration driver to the chain

The configuration driver will be placed according to its priority.
Highest priority will be verified first

@param ConfigurationInterface $config
@param integer $priority

@return ConfigurationChainInterface self
7854
public function add(ConfigurationInterface $config, $priority = 0)
    {
        $this->priorityList->insert($config, $priority);
        return $this;
    }
21588
public static function create(ProviderInterface $provider, array $config)
    {
        return OAuth1Factory::create(
            array_merge($provider->getUriConfig(), $config),
            $provider->getSigner()
        );
    }
145744
public function setConfig(GridFieldConfig $config)
    {
        $this->config = $config;

        if (!$this->config->getComponentByType(GridState_Component::class)) {
            $this->config->addComponent(new GridState_Component());
        }

        return $this;
    }
63054
public function addProvider(Provider $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        ksort($this->providers);
    }
888117
public function load($config) {
		if ($this->configsDir === null) {
			new Exceptions\ConfiguratorError('Directory of configuration files did not been set');
		}
		
		$file = $this->configsDir->getFile($config);
		
		$this->addConfigReader($this->initReader($file));
		
		return $this;
	}
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
1325038
public function put(array $config)
    {
        foreach ($config as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
1202237
private static function createDriverChain(Configuration $ormConfig, array $config)
    {
        $chain = new MappingDriverChain();
        $paths = $config['driver']['paths'];

        if (empty($paths)) {
            return $chain;
        }

        switch ($config['driver']['type']) {
            case self::DRIVER_ANNOTATION:
                $driver = $ormConfig->newDefaultAnnotationDriver($paths, $config['driver']['simple']);
                break;
            case self::DRIVER_XML:
                $driver = new XmlDriver($paths);
                break;
            case self::DRIVER_YAML:
                $driver = new YamlDriver($paths);
                break;
            default:
                throw new Exception\InvalidDriver('Valid driver types are: annotation, yaml, xml');
        }

        $chain->setDefaultDriver($driver);
        return $chain;
    }
1261156
protected function applyCommands(Config $config)
    {
        $commands = $config->get('commands', null);

        $config->set('commands', []);

        if (!isset($commands) || !is_array($commands) || !count($commands)) {
            return $this;
        }

        foreach ($commands as $commandName => $command) {
            if (!($command instanceof CommandInterface)) {
                $command = $this->instantiateCommand($command);
            }
            $config->setItem('commands', $commandName, $command);
        }

        return $this;
    }
780074
public function connect(array $config)
	{
		$ironConfig = array('token' => $config['token'], 'project_id' => $config['project']);

		if (isset($config['host'])) $ironConfig['host'] = $config['host'];

		return new IronQueue(new IronMQ($ironConfig), $this->crypt, $this->request, $config['queue']);
	}
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;
    }
1033359
private function configureMapManager($config, ContainerBuilder $container)
    {
        $mapManager = $container->getDefinition('sulu_location.map_manager');

        foreach ($config['enabled_providers'] as $enabledProviderName) {
            $providerConfig = $config['providers'][$enabledProviderName];
            $mapManager->addMethodCall('registerProvider', [
                $enabledProviderName,
                $providerConfig,
            ]);
        }

        foreach ($config['geolocators'] as $geoLocatorName => $geoLocatorOptions) {
            $mapManager->addMethodCall('registerGeolocator', [
                $geoLocatorName,
                $geoLocatorOptions,
            ]);
        }

        $mapManager->addMethodCall('setDefaultProviderName', [$config['default_provider']]);
    }
123254
private function __buildConfig(array $config)
    {
        foreach ($config as $key => $conf) {
            if ($key == 'driver') {
                $this->rawConfig['type'] = strtolower($conf);
                continue;
            }

            if (!array_key_exists($key, $this->rawConfig)) {
                $this->error->setMessage(sprintf(
                    "invalid config '%s', allowed config are: %s",
                    $key, implode(', ', array_keys($this->rawConfig))
                ));
                break;
            }

            $this->rawConfig[$key] = $conf;
        }

        if (!$this->error->hasError() && !$this->hasDriver($this->getType()) && !$this->preventNoLocalDriver) {
            $this->error->setMessage(sprintf(
                "Driver '%s' not available. Please choose one of: '%s'. ".
                'Or register new ConnectionString class by implements %s.',
                $this->getType(),
                implode("', '", $this->getAvailableDrivers()),
                ConnectionStringInterface::class
            ));
        }
    }
789659
public static function getInstance(array $config = array(), DriverInterface $driver = null)
    {
        static $instance = null;

        if (null === $instance) {
            $instance = new static();
        }

        if ($config) {
            $instance->config = $config;
        }

        if ($driver) {
            $instance->driver = $driver;
        }

        return $instance;
    }
575177
public function setup($config = [])
    {
        $path = toPath($config['path']);

        if (is_array($config)) {
            $this->setCache($config['name']);
            $this->setPath(CYGNITE_BASE.DS.$path.DS);
            $this->setCacheExtension($config['extension']);

            return $this;
        }

        $this->setCache($config);

        return $this;
    }
499144
public function createConnector(array $config)
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('A driver must be specified.');
        }

        switch ($config['driver']) {
            case 'awss3':
                return new AwsS3Connector();
            case 'azure':
                return new AzureConnector();
            case 'dropbox':
                return new DropboxConnector();
            case 'ftp':
                return new FtpConnector();
            case 'gridfs':
                return new GridFSConnector();
            case 'local':
                return new LocalConnector();
            case 'null':
                return new NullConnector();
            case 'rackspace':
                return new RackspaceConnector();
            case 'sftp':
                return new SftpConnector();
            case 'webdav':
                return new WebDavConnector();
            case 'zip':
                return new ZipConnector();
        }

        throw new InvalidArgumentException("Unsupported driver [{$config['driver']}].");
    }
745990
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
        ));

        parent::_initialize($config);
    }