Loads a specific configuration.

@param array            $configs   An array of configuration values
@param ContainerBuilder $container A ContainerBuilder instance
978430
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('security.firewall_matcher', 'Symfony\Component\HttpFoundation\RequestMatcher')
            ->setPublic(false)
            ->addArgument($config['firewall']);
        $container->register('security.auth_matcher', 'Symfony\Component\HttpFoundation\RequestMatcher')
            ->setPublic(false)
            ->addArgument($config['login_path'])
            ->addArgument(null)
            ->addArgument('POST');
        $container->register('security.logout_matcher', 'Symfony\Component\HttpFoundation\RequestMatcher')
            ->setPublic(false)
            ->addArgument($config['logout_path']);

        $authenticatorService = $this->configureAuthenticator($config['authenticator'], $container);

        $container->register('security.security_subscriber', 'Nice\Security\FirewallSubscriber')
            ->addArgument(new Reference('event_dispatcher'))
            ->addArgument(new Reference('security.firewall_matcher'))
            ->addArgument(new Reference('security.auth_matcher'))
            ->addArgument(new Reference('security.logout_matcher'))
            ->addArgument(new Reference($authenticatorService))
            ->addArgument($config['login_path'])
            ->addArgument($config['success_path'])
            ->addArgument($config['token_session_key'])
            ->addTag('kernel.event_subscriber');

        $container->register('security.auth_failure_subscriber', 'Nice\Security\AuthenticationFailureSubscriber')
            ->addTag('kernel.event_subscriber');
    }
435502
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('profiler.xml');

        if ($config['toolbar'] || $config['intercept_redirects']) {
            $loader->load('toolbar.xml');
            $container->getDefinition('web_profiler.debug_toolbar')->replaceArgument(4, $config['excluded_ajax_paths']);
            $container->setParameter('web_profiler.debug_toolbar.intercept_redirects', $config['intercept_redirects']);
            $container->setParameter('web_profiler.debug_toolbar.mode', $config['toolbar'] ? WebDebugToolbarListener::ENABLED : WebDebugToolbarListener::DISABLED);
        }

        if (Kernel::VERSION_ID >= 40008 || (Kernel::VERSION_ID >= 30408 && Kernel::VERSION_ID < 40000)) {
            $container->getDefinition('debug.file_link_formatter')
                ->replaceArgument(3, new ServiceClosureArgument(new Reference('debug.file_link_formatter.url_format')));
        }
    }
1170683
public function load(array $configs, ContainerBuilder $container)
    {
        parent::load($configs, $container);

        $configs = $this->processConfiguration(new Configuration(), $configs);

        $sources = $container->hasParameter('graviton.proxy.sources') ?
            $container->getParameter('graviton.proxy.sources') : [];

        $container->setParameter('graviton.proxy.sources', array_merge_recursive($configs['sources'], $sources));
    }
352307
public function load(array $configs, ContainerBuilder $container)
    {
        parent::load($configs, $container);

        // define alias for the strategy to extract the authentication key from the Airlock request.
        $container->setAlias(
            'graviton.security.authentication.strategy',
            $container->getParameter('graviton.security.authentication.strategy')
        );

        $container->setAlias(
            'graviton.security.authentication.dynamic.model',
            $container->getParameter('graviton.security.authentication.provider.model')
        );
    }
569917
public function load(array $configs, ContainerBuilder $container)
    {
        $curlConfigFile   = __DIR__ . '/../Resources/config/curl_config.yml';
        $configs          = array_merge(Yaml::parse(file_get_contents($curlConfigFile)), $configs);
        if (!isset($configs['circle_rest_client'])) throw new \RuntimeException('configuration circle_rest_client is missing.');

        $configuration  = new Configuration();
        $config         = $this->processConfiguration($configuration, $configs);

        if (!isset($config['curl'])) throw new \RuntimeException('configuration circle_rest_client.curl is missing.');
        if (!isset($config['curl']['defaults'])) throw new \RuntimeException('configuration circle_rest_client.curl.defaults is missing.');

        $options = array();
        foreach ($config['curl']['defaults'] as $key => $value) {
            $options[constant($key)] = $value;
        };

        $container->setParameter('circle.restclient.curl.defaults', $options);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }
770314
public function load(array $configs, ContainerBuilder $container)
    {
        $config = $this->processConfiguration($this->createConfiguration(), $configs);

        $container->setParameter('eavmanager_user.config', $config);

        parent::load($configs, $container);
    }
879841
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yml');

        if (array_key_exists('apple', $config)) {
            $this->buildApple($loader, $container, $config['apple'], $config['connection_handler']);
        }

        if (array_key_exists('android', $config)) {
            $this->buildAndroid($loader, $container, $config['android'], $config['connection_handler']);
        }

        if (array_key_exists('windows', $config)) {
            $this->buildWindows($loader, $container, $config['windows'], $config['connection_handler']);
        }
    }
75723
public function load(array $configs, ContainerBuilder $container): void
    {
        $configuration = new Req2CmdConfiguration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('actions.xml');
        $loader->load('extractors.xml');
        $loader->load('listeners.xml');
        $loader->load('param_mappers.xml');
        $loader->load('command_bus.xml');
        $loader->load('serializer.xml');

        $this->configureExtractors($config, $container);
        $this->configureCommandBus($config, $container);
        $this->configureEventListeners($config, $container);
    }
1184039
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $container->setParameter(
            'twig.form.resources',
            array_merge(
                $container->hasParameter('twig.form.resources') ? $container->getParameter('twig.form.resources') : [],
                array('KunstmaanMediaBundle:Form:formWidgets.html.twig')
            )
        );
        $container->setParameter('kunstmaan_media.soundcloud_api_key', $config['soundcloud_api_key']);
        $container->setParameter('kunstmaan_media.remote_video', $config['remote_video']);
        $container->setParameter('kunstmaan_media.enable_pdf_preview', $config['enable_pdf_preview']);
        $container->setParameter('kunstmaan_media.blacklisted_extensions', $config['blacklisted_extensions']);
        $container->setParameter('kunstmaan_media.web_root', $config['web_root']);
        $container->setParameter('kunstmaan_media.full_media_path', $config['web_root'] . '%kunstmaan_media.media_path%');

        $loader->load('services.yml');
        $loader->load('handlers.yml');

        if ($config['enable_pdf_preview'] === true) {
            $loader->load('pdf_preview.yml');
        }

        $container->setParameter('liip_imagine.filter.loader.background.class', 'Kunstmaan\MediaBundle\Helper\Imagine\BackgroundFilterLoader');

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('imagine.xml');

        $container->setAlias('liip_imagine.controller', 'Kunstmaan\MediaBundle\Helper\Imagine\ImagineController')->setPublic(true);
        $container->setAlias('Liip\ImagineBundle\Controller\ImagineController', 'Kunstmaan\MediaBundle\Helper\Imagine\ImagineController')->setPublic(true);
        $container->setAlias('liip_imagine.cache.resolver.prototype.web_path', 'Kunstmaan\MediaBundle\Helper\Imagine\WebPathResolver');
        $container->setAlias('liip_imagine.cache.manager', 'Kunstmaan\MediaBundle\Helper\Imagine\CacheManager')->setPublic(true);
        $container->setAlias('liip_imagine.filter.loader.background', 'kunstmaan_media.imagine.filter.loader.background')->setPublic(true);

        $this->addAvairyApiKeyParameter($container, $config);
    }
1189455
public function load(array $configs, ContainerBuilder $container)
    {
        // Load DoctrineRiakBundle/Resources/config/riak.xml
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('riak.xml');

        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        if (empty($config['default_connection'])) {
            $keys = array_keys($config['connections']);
            $config['default_connection'] = reset($keys);
        }
        $container->setParameter('doctrine_riak.odm.default_connection', $config['default_connection']);

        if (empty($config['default_document_manager'])) {
            $keys = array_keys($config['document_managers']);
            $config['default_document_manager'] = reset($keys);
        }
        $container->setParameter('doctrine_riak.odm.default_document_manager', $config['default_document_manager']);

        // set some options as parameters and unset them
        $config = $this->overrideParameters($config, $container);

        // load the connections
        $this->loadConnections($config['connections'], $container);

        // load the document managers
        $this->loadDocumentManagers(
            $config['document_managers'],
            $config['default_document_manager'],
            $config['default_database'],
            $container
        );

        if ($config['resolve_target_documents']) {
            $def = $container->findDefinition('doctrine_riak.odm.listeners.resolve_target_document');
            foreach ($config['resolve_target_documents'] as $name => $implementation) {
                $def->addMethodCall('addResolveTargetDocument', array($name, $implementation, array()));
            }
            $def->addTag('doctrine_riak.odm.event_listener', array('event' => 'loadClassMetadata'));
        }

        // BC Aliases for Document Manager
        //$container->setAlias('doctrine.odm.riak.document_manager', new Alias('doctrine_riak.odm.document_manager'));
    }
1012961
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new FlowConfiguration();
        $processor = new Processor();
        $this->flowsConfig = $processor->processConfiguration($configuration, $configs);
    }
278294
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $bundles = $container->getParameter('kernel.bundles');

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('actions.xml');
        $loader->load('orm.xml');
        $loader->load('twig.xml');
        $loader->load('form.xml');
        $loader->load('core.xml');
        $loader->load('serializer.xml');
        $loader->load('command.xml');

        if (isset($bundles['SonataBlockBundle'])) {
            $loader->load('block.xml');
        }

        if (isset($bundles['FOSRestBundle'], $bundles['NelmioApiDocBundle'])) {
            $loader->load('api_controllers.xml');
            $loader->load('api_form.xml');
        }

        if (isset($bundles['SonataAdminBundle'])) {
            $loader->load('admin.xml');
        }

        if (!isset($config['salt'])) {
            throw new \InvalidArgumentException(
                'The configuration node "salt" is not set for the SonataNewsBundle (sonata_news)'
            );
        }

        if (!isset($config['comment'])) {
            throw new \InvalidArgumentException(
                'The configuration node "comment" is not set for the SonataNewsBundle (sonata_news)'
            );
        }

        $container->getDefinition('sonata.news.hash.generator')
            ->replaceArgument(0, $config['salt']);

        $container->getDefinition('sonata.news.permalink.date')
            ->replaceArgument(0, $config['permalink']['date']);

        $container->setAlias('sonata.news.permalink.generator', $config['permalink_generator']);

        $container->setDefinition('sonata.news.blog', new Definition('Sonata\NewsBundle\Model\Blog', [
            $config['title'],
            $config['link'],
            $config['description'],
            new Reference('sonata.news.permalink.generator'),
        ]));

        $container->getDefinition('sonata.news.hash.generator')
            ->replaceArgument(0, $config['salt']);

        $container->getDefinition('sonata.news.mailer')
            ->replaceArgument(5, [
                'notification' => $config['comment']['notification'],
            ]);

        $this->registerDoctrineMapping($config);
        $this->configureClass($config, $container);
        $this->configureAdmin($config, $container);
    }
526225
public function load(array $configs, ContainerBuilder $container)
    {
        $configs = (new Processor)->processConfiguration(new Configuration(), $configs);

        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yml');
        $loader->load('twig_extensions.yml');
        $loader->load('form_types.yml');
        $loader->load('ref_id_providers.yml');

        if (extension_loaded("redis")) {
            $container->setParameter('kunstmaan_extra.redis_host', $configs['redis']['host']);
            $container->setParameter('kunstmaan_extra.redis_port', $configs['redis']['port']);
            $container->setParameter('kunstmaan_extra.redis_password', $configs['redis']['password']);
            $loader->load('redis_services.yml');
        }

        $container->setParameter('kunstmaan_extra.bem', $configs['bem']);

        $container->setParameter('kunstmaan_node_search.search_configuration.node.class', KunstmaanExtraNodePagesConfiguration::class);
        $container->setParameter('kunstmaan_search.search.class', ChainSearchProvider::class);

        if ($configs['search']['url']) {
            $container->setParameter(CompilerPass\ElasticSearchCompilerPass::PARAM_SEARCH_URL, $configs['search']['url']);
        }

        $container->setParameter('kunstmaan_extra.search.replicas', $configs['search']['replicas']);
        $container->setParameter('kunstmaan_extra.search.shards', $configs['search']['shards']);

        $container->setParameter('kunstmaan_extra.date_formats', isset($configs['date_formats']) ? $configs['date_formats'] : []);

        if ($configs['assets']['web_prefix']) {
            $container->setParameter('kunstmaan_extra.assets.cdn_url', $configs['assets']['cdn_url']);
            $container->setParameter('kunstmaan_extra.assets.web_prefix', $configs['assets']['web_prefix']);
            $loader->load('assets.yml');
        }

        if ($configs['tinypng_api_key']) {
            $container->setParameter('kunstmaan_extra.tinypng_api_key', $configs['tinypng_api_key']);
            $loader->load('imagine_tinypng_services.yml');
        }

        if ($configs['imgix']['bucket']) {
            $container->setParameter('kunstmaan_extra.imgix_bucket', $configs['imgix']['bucket']);
            $container->setParameter('kunstmaan_extra.imgix_presets', $configs['imgix']['presets']);
            $loader->load('imagine_imgix_services.yml');
        }

        $container->setParameter('kunstmaan_extra.typography.orphans', $configs['typography']['orphans']);

        if ($configs['generate_controller']) {
            $container->setDefinition('kunstmaan_extra.typehinting_controller_cache_warmer', (new Definition)
                ->setClass(TypehintingControllerCacheWarmer::class)
                ->setArguments([new Reference('kernel'), $configs['generate_controller']])
                ->addTag('kernel.cache_warmer')
            );
        }
    }
1359048
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration($container->getParameter('kernel.debug'));
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('view.xml');
        $loader->load('routing.xml');
        $loader->load('request.xml');
        $loader->load('serializer.xml');

        $container->getDefinition('fos_rest.routing.loader.controller')->replaceArgument(4, $config['routing_loader']['default_format']);
        $container->getDefinition('fos_rest.routing.loader.yaml_collection')->replaceArgument(4, $config['routing_loader']['default_format']);
        $container->getDefinition('fos_rest.routing.loader.xml_collection')->replaceArgument(4, $config['routing_loader']['default_format']);

        $container->getDefinition('fos_rest.routing.loader.yaml_collection')->replaceArgument(2, $config['routing_loader']['include_format']);
        $container->getDefinition('fos_rest.routing.loader.xml_collection')->replaceArgument(2, $config['routing_loader']['include_format']);
        $container->getDefinition('fos_rest.routing.loader.reader.action')->replaceArgument(3, $config['routing_loader']['include_format']);
        $container->getDefinition('fos_rest.routing.loader.reader.action')->replaceArgument(5, $config['routing_loader']['prefix_methods']);

        foreach ($config['service'] as $key => $service) {
            if ('validator' === $service && empty($config['body_converter']['validate'])) {
                continue;
            }

            if (null !== $service) {
                if ('view_handler' === $key) {
                    $container->setAlias('fos_rest.'.$key, new Alias($service, true));
                } else {
                    $container->setAlias('fos_rest.'.$key, $service);
                }
            }
        }

        $this->loadForm($config, $loader, $container);
        $this->loadException($config, $loader, $container);
        $this->loadBodyConverter($config, $loader, $container);
        $this->loadView($config, $loader, $container);

        $this->loadBodyListener($config, $loader, $container);
        $this->loadFormatListener($config, $loader, $container);
        $this->loadVersioning($config, $loader, $container);
        $this->loadParamFetcherListener($config, $loader, $container);
        $this->loadAllowedMethodsListener($config, $loader, $container);
        $this->loadAccessDeniedListener($config, $loader, $container);
        $this->loadZoneMatcherListener($config, $loader, $container);

        // Needs RequestBodyParamConverter and View Handler loaded.
        $this->loadSerializer($config, $container);
    }
132176
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('manager.xml');

        $templates = array();
        foreach ($configs as $config) {
            $templates = array_merge($templates, $config['templates']);
        }

        foreach($templates as $name => $template) {
            $container->findDefinition('knp_zend_cache.manager')->addMethodCall('setCacheTemplate', array($name, $template));
        }
    }
724208
public function load(array $config, ContainerBuilder $container)
    {
        $container->addObjectResource($this);

        $configuration = $this->getConfiguration($config, $container);
        if ($configuration instanceof ConfigurationInterface) {
            $config = $this->processConfiguration($configuration, $config);
            $this->applyParametrizedValues($config, $container);
        }

        $configFiles = $this->getConfigFiles($config);
        if (!empty($configFiles)) {
            $this->loadFiles($configFiles, $container);
        }

        $this->postLoad($config, $container);
    }
968203
public function load(array $configs, ContainerBuilder $container): void
    {
        $loader = new YamlFileLoader($container, new FileLocator());
        $loader->load(__DIR__ . '/../service_bus.yaml');

        /**
         * @var string $key
         * @var mixed  $value
         *
         * @psalm-suppress MixedAssignment Cannot assign $value to a mixed type
         */
        foreach ($configs as $key => $value)
        {
            $container->setParameter($key, $value);
        }
    }