{@inheritDoc}

@param array            $configs   configs to load
@param ContainerBuilder $container builder used to load

@return void
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')
        );
    }
248226
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('consumer.xml');
        $loader->load('orm.xml');
        $loader->load('payment.xml');
        $loader->load('generator.xml');
        $loader->load('transformer.xml');
        $loader->load('selector.xml');
        $loader->load('browser.xml');
        $loader->load('form.xml');

        $this->registerDoctrineMapping($config);
        $this->registerParameters($container, $config);
        $this->configurePayment($container, $config);
        $this->configureSelector($container, $config['selector']);
        $this->configureTransformer($container, $config['transformers']);

        $container->setAlias('sonata.generator', $config['generator']);
    }
1331181
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        $config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs);

        $container->setParameter('windows_azure_distribution.config.deployment', $config['deployment']);
        $container->setParameter('windows_azure_distribution.streams', $config['streams']);

        $this->loadSession($config, $container);
        $this->loadAsset($config['assets'], $container);
        $this->loadSharding($config, $container);
        $this->loadServices($config, $container);
        $this->loadKeyValueStore($config, $container, $loader);
    }
258765
public function load(array $configs, ContainerBuilder $container)
    {
        // Parse configuration
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

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

        // Toolbar
        $loader->load('toolbar.xml');
        if ($config['toolbar'] === 'demo') {
            $mode = ToolbarListener::DEMO;
        }
        else if ($config['toolbar']) {
            $mode = ToolbarListener::ENABLED;
        }
        else {
            $mode = ToolbarListener::DISABLED;
        }

        // Other Services
        $loader->load('services.xml');

        // Set parameter
        $container->setParameter('terrific_composer.toolbar.mode', $mode);
        $container->setParameter('terrific_composer.composition.bundles', $config['composition_bundles']);
        $container->setParameter('terrific_composer.module.layout', $config['module_layout']);
        $container->setParameter('terrific_composer.module.template', $config['module_template']);
    }
1366421
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->createConfigurationParser();
        $this->globalConfiguration = $this->processConfiguration($configuration, $configs);

        $container->setParameter('sidus_eav_publishing.queue.configuration', $this->globalConfiguration['queue']);

        foreach ($this->globalConfiguration['publishers'] as $code => $publisherConfiguration) {
            $this->createPublisherService($code, $publisherConfiguration, $container);
        }

        $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);
    }
571239
public function load(array $configs, ContainerBuilder $container)
    {
        // Get default configuration of the bundle
        $config = $this->processConfiguration(new Configuration(), $configs);

        if (empty($config['theme'])) {
            $config['theme'] = array(
                'simple' => array(),
            );
        } else {
            foreach ($config['theme'] as &$bundleTheme) {
                // Quick fix for the removed obsolete themes
                if (isset($bundleTheme['theme']) && in_array($bundleTheme['theme'], array('advanced', 'simple'))) {
                    $bundleTheme['theme'] = 'modern';
                }
                unset($bundleTheme);
            }
        }

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

        // load dependency injection config
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('service.xml');
    }
1146774
public function load(array $configs, ContainerBuilder $container)
    {
        $config = $this->processConfiguration(new Configuration(), $configs);

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

        if (isset($config['quicklist'])) {
            $loader->load('quicklist.xml');
            foreach ($config['quicklist'] as $name => $quicklistConfig) {
                $container->getDefinition('zicht_admin.quicklist')
                    ->addMethodCall('addRepositoryConfig', array($name, $quicklistConfig));

                $formResources = $container->getParameter('twig.form.resources');
                $formResources[]= 'ZichtAdminBundle::form_theme.html.twig';
                $container->setParameter('twig.form.resources', $formResources);
            }
        }

        if (isset($config['transactional_listener']) && $config['transactional_listener']['auto']) {
            $loader->load('transactional_listener.xml');

            $container->getDefinition('zicht_admin.transactional_listener')
                ->addArgument($config['transactional_listener']['pattern']);
        }

        if (isset($config['rc'])) {
            $loader->load('rc.xml');
            $container->getDefinition('zicht_admin.controller.rc')->replaceArgument(0, $config['rc']);
        }

        $container->getDefinition('zicht_admin.security.authorization.voter.admin_voter')
            ->replaceArgument(0, $config['security']['mapped_attributes']);
    }
430629
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

        if (!empty($config['signed_cookie']['names'])) {
            $loader->load('signed_cookie.yml');
            $container->setParameter('nelmio_security.signed_cookie.names', $config['signed_cookie']['names']);
            $container->setParameter('nelmio_security.signer.secret', $config['signed_cookie']['secret']);
            $container->setParameter('nelmio_security.signer.hash_algo', $config['signed_cookie']['hash_algo']);
        }

        if (!empty($config['encrypted_cookie']['names'])) {
            $loader->load('encrypted_cookie.yml');
            $container->setParameter('nelmio_security.encrypted_cookie.names', $config['encrypted_cookie']['names']);
            $container->setParameter('nelmio_security.encrypter.secret', $config['encrypted_cookie']['secret']);
            $container->setParameter('nelmio_security.encrypter.algorithm', $config['encrypted_cookie']['algorithm']);
        }

        if (!empty($config['clickjacking'])) {
            $loader->load('clickjacking.yml');
            $container->setParameter('nelmio_security.clickjacking.paths', $config['clickjacking']['paths']);
            $container->setParameter('nelmio_security.clickjacking.content_types', $config['clickjacking']['content_types']);
        }

        if (!empty($config['csp']) && $config['csp']['enabled']) {
            if (version_compare(Kernel::VERSION, '2.6', '>=')) {
                $loader->load('csp.yml');
            } else {
                $loader->load('csp_legacy.yml');
            }

            $cspConfig = $config['csp'];

            $enforceDefinition = $this->buildDirectiveSetDefinition($container, $cspConfig, 'enforce');
            $reportDefinition = $this->buildDirectiveSetDefinition($container, $cspConfig, 'report');

            $cspListenerDefinition = $container->getDefinition('nelmio_security.csp_listener');
            $cspListenerDefinition->setArguments(array($reportDefinition, $enforceDefinition, new Reference('nelmio_security.nonce_generator'), new Reference('nelmio_security.sha_computer'), (bool) $cspConfig['compat_headers'], $cspConfig['hosts'], $cspConfig['content_types']));
            $container->setParameter('nelmio_security.csp.hash_algorithm', $cspConfig['hash']['algorithm']);

            $cspViolationLogFilterDefinition = $container->getDefinition('nelmio_security.csp_report.filter');

            $container->setParameter('nelmio_security.csp.report_log_level', $cspConfig['report_endpoint']['log_level']);

            if (count($cspConfig['report_endpoint']['dismiss']) > 0) {
                $container->getDefinition('nelmio_security.csp_report.filter.noise_detector_custom_rules')
                    ->replaceArgument(0, $cspConfig['report_endpoint']['dismiss']);
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_custom_rules')));
            }

            if ($cspConfig['report_endpoint']['filters']['domains']) {
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_domains')));
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_domains_regex')));
            }

            if ($cspConfig['report_endpoint']['filters']['schemes']) {
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_schemes')));
            }

            if ($cspConfig['report_endpoint']['filters']['injected_scripts']) {
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_injected_scripts')));
            }

            if ($cspConfig['report_endpoint']['filters']['browser_bugs']) {
                $cspViolationLogFilterDefinition->addMethodCall('addNoiseDetector', array(new Reference('nelmio_security.csp_report.filter.noise_detector_browser_bugs')));
            }

            $loggerDefinition = $container->getDefinition('nelmio_security.csp_report.logger');
            $loggerDefinition->replaceArgument(0, new Reference($cspConfig['report_logger_service']));
            $loggerDefinition->replaceArgument(1, new Reference($cspConfig['report_endpoint']['log_formatter']));

            if ($cspConfig['report_endpoint']['log_channel']) {
                $loggerDefinition->addTag('monolog.logger', array('channel' => $cspConfig['report_endpoint']['log_channel']));
            }
        }

        if (!empty($config['xss_protection'])) {
            if (version_compare(Kernel::VERSION, '2.6', '>=')) {
                $loader->load('xss_protection.yml');
            } else {
                $loader->load('xss_protection_legacy.yml');
            }

            $container->getDefinition('nelmio_security.xss_protection_listener')
                ->setArguments(array($config['xss_protection']));
        }

        if (!empty($config['content_type'])) {
            $loader->load('content_type.yml');
            $container->setParameter('nelmio_security.content_type.nosniff', $config['content_type']['nosniff']);
        }

        if (!empty($config['external_redirects'])) {
            $loader->load('external_redirects.yml');
            $container->setParameter('nelmio_security.external_redirects.override', $config['external_redirects']['override']);
            $container->setParameter('nelmio_security.external_redirects.forward_as', $config['external_redirects']['forward_as']);
            $container->setParameter('nelmio_security.external_redirects.abort', $config['external_redirects']['abort']);
            if ($config['external_redirects']['whitelist']) {
                $whitelist = array_map(function ($el) {
                    if ($host = parse_url($el, PHP_URL_HOST)) {
                        return ltrim($host, '.');
                    }

                    return ltrim($el, '.');
                }, $config['external_redirects']['whitelist']);
                $whitelist = array_map('preg_quote', $whitelist);
                $whitelist = '(?:.*\.'.implode('|.*\.', $whitelist).'|'.implode('|', $whitelist).')';
                $container->setParameter('nelmio_security.external_redirects.whitelist', $whitelist);
            }
            if (!$config['external_redirects']['log']) {
                $def = $container->getDefinition('nelmio_security.external_redirect_listener');
                $def->replaceArgument(4, null);
            }
        }

        if (!empty($config['flexible_ssl']) && $config['flexible_ssl']['enabled']) {
            $loader->load('flexible_ssl.yml');
            $container->setParameter('nelmio_security.flexible_ssl.cookie_name', $config['flexible_ssl']['cookie_name']);
            $container->setParameter('nelmio_security.flexible_ssl.unsecured_logout', $config['flexible_ssl']['unsecured_logout']);
        }

        if (!empty($config['cookie_session']) && $config['cookie_session']['enabled']) {
            $loader->load('cookie_session.yml');
            $container->setParameter('nelmio_security.cookie_session.name', $config['cookie_session']['name']);
            $container->setParameter('nelmio_security.cookie_session.lifetime', $config['cookie_session']['lifetime']);
            $container->setParameter('nelmio_security.cookie_session.path', $config['cookie_session']['path']);
            $container->setParameter('nelmio_security.cookie_session.domain', $config['cookie_session']['domain']);
            $container->setParameter('nelmio_security.cookie_session.secure', $config['cookie_session']['secure']);
            $container->setParameter('nelmio_security.cookie_session.httponly', $config['cookie_session']['httponly']);
        }

        if (!empty($config['forced_ssl']) && $config['forced_ssl']['enabled']) {
            $loader->load('forced_ssl.yml');
            if ($config['forced_ssl']['hsts_max_age'] > 0) {
                $def = $container->getDefinition('nelmio_security.forced_ssl_listener');
                $def->addTag('kernel.event_listener', array('event' => 'kernel.response', 'method' => 'onKernelResponse'));
            }
            $container->setParameter('nelmio_security.forced_ssl.hsts_max_age', $config['forced_ssl']['hsts_max_age']);
            $container->setParameter('nelmio_security.forced_ssl.hsts_subdomains', $config['forced_ssl']['hsts_subdomains']);
            $container->setParameter('nelmio_security.forced_ssl.hsts_preload', $config['forced_ssl']['hsts_preload']);
            $container->setParameter('nelmio_security.forced_ssl.whitelist', $config['forced_ssl']['whitelist']);
            $container->setParameter('nelmio_security.forced_ssl.hosts', $config['forced_ssl']['hosts']);
            $container->setParameter('nelmio_security.forced_ssl.redirect_status_code', $config['forced_ssl']['redirect_status_code']);
        }

        if (!empty($config['referrer_policy']) && $config['referrer_policy']['enabled']) {
            $loader->load('referrer_policy.yml');
            $container->setParameter('nelmio_security.referrer_policy.policies', $config['referrer_policy']['policies']);
        }
    }
13920
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('doctrine.orm.metadata_driver', 'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain');

        foreach ($config['mapping'] as $name => $mappingConfig) {
            $mappingConfig['name'] = $name;
            $this->configureMappingDriver($mappingConfig, $container);
        }

        $container->register('doctrine.orm.configuration', 'Doctrine\ORM\Configuration')
            ->addMethodCall('setMetadataDriverImpl', array(new Reference('doctrine.orm.metadata_driver')))
            ->addMethodCall('setProxyNamespace', array('Proxy'));

        if ($container->hasParameter('app.cache') && $container->getParameter('app.cache') === true) {
            $container->getDefinition('doctrine.orm.configuration')
                ->addMethodCall('setProxyDir', array('%app.cache_dir%/doctrine'));
        } else {
            $container->getDefinition('doctrine.orm.configuration')
                ->addMethodCall('setProxyDir', array(sys_get_temp_dir().'/doctrine'))
                ->addMethodCall('setAutoGenerateProxyClasses', array(AbstractProxyFactory::AUTOGENERATE_EVAL));

        }

        $container->register('doctrine.orm.entity_manager', 'Doctrine\ORM\EntityManager')
            ->setFactoryClass('Doctrine\ORM\EntityManager')
            ->setFactoryMethod('create')
            ->addArgument($config['database'])
            ->addArgument(new Reference('doctrine.orm.configuration'));

        $container->setAlias('doctrine.dbal.configuration', new Alias('doctrine.orm.configuration'));

        $container->register('doctrine.dbal.database_connection', 'Doctrine\DBAL\Connection')
            ->setFactoryService('doctrine.orm.entity_manager')
            ->setFactoryMethod('getConnection');
    }
287301
public function loadInternal(array $configs, ContainerBuilder $container): void
    {
        $file = $this->getServiceName();
        if (!file_exists($file)) {
            throw new BadMethodCallException('"'.$file.'" doesn\'t exist!');
        }
        $parts = pathinfo($file);

        switch ($parts['extension']) {
            case 'xml':
                $loader = new XmlFileLoader($container, new FileLocator($parts['dirname']));
            break;
            case 'yml':
            case 'yaml':
                $loader = new YamlFileLoader($container, new FileLocator($parts['dirname']));
                break;
            default:
                throw new BadMethodCallException(
                    'This extension does not accept ".'
                    .$parts['extension']
                    .'" extension, only ".yml", ".yaml" or ".xml"!'
                );
        }
        $loader->load($parts['basename']);
        $this->setConfigParameters($configs, $container);
    }
798670
public function load(ContainerBuilder $container, array $config)
    {
        $this->loadPauser($container);
        $this->loadController($container);
        $this->loadListener($container);
    }
187162
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('redis.xml');

        $mainConfig = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($mainConfig, $configs);

        foreach ($config['class'] as $name => $class) {
            $container->setParameter(sprintf('snc_redis.%s.class', $name), $class);
        }

        foreach ($config['clients'] as $client) {
            $this->loadClient($client, $container);
        }

        if (isset($config['session'])) {
            $this->loadSession($config, $container, $loader);
        }

        if (isset($config['doctrine']) && count($config['doctrine'])) {
            $this->loadDoctrine($config, $container);
        }

        if (isset($config['monolog'])) {
            if (!empty($config['clients'][$config['monolog']['client']]['logging'])) {
                throw new InvalidConfigurationException(sprintf('You have to disable logging for the client "%s" that you have configured under "snc_redis.monolog.client"', $config['monolog']['client']));
            }
            $this->loadMonolog($config, $container);
        }

        if (isset($config['swiftmailer'])) {
            $this->loadSwiftMailer($config, $container);
        }

        if (isset($config['profiler_storage'])) {
            $this->loadProfilerStorage($config, $container, $loader);
        }
    }
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);
    }
945538
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('converter.xml');
        $loader->load('event.xml');
        $loader->load('event_listeners.xml');
        $loader->load('command.xml');
        $loader->load('indexer.xml');
        $loader->load('queue.xml');
        $loader->load('solarium.xml');
        $loader->load('task.xml');
        $loader->load('types.xml');
        $loader->load('worker.xml');

        if ($container->getParameter('kernel.debug')) {
            $loader->load('collector.xml');
        }

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

        $endpoints = [];

        foreach ($config['endpoints'] as $name => $options) {
            $options['key'] = $name;
            $container->setDefinition(
                'solarium.client.endpoint.' . $name,
                new Definition(Endpoint::class, [$options])
            );

            $endpoints[] = new Reference('solarium.client.endpoint.' . $name);
        }

        $container->setDefinition(
            'solarium.client',
            new Definition(
                Client::class,
                [
                    ['endpoint' => $endpoints],
                    new Reference('integrated_solr.event.dispatcher')
                ]
            )
        );

        if ($container->getParameter('kernel.debug')) {
            $container->getDefinition('solarium.client')->addMethodCall(
                'registerPlugin',
                ['solarium.client.logger', new Reference('integrated_solr.solarium.data_collector')]
            );
        }
    }
692233
public function load(ContainerBuilder $container, array $config)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/config'));
        $loader->load('services.xml');

        if (!empty($config['path'])) {
            if (isset($config['path']['resources'])) {
                $container->setParameter('paths.resources.resource', $config['path']['resources']);
            }

            if (isset($config['path']['base'])) {
                $container->setParameter('paths.resources.base', $config['path']['base']);
            }
        }

        if (!empty($config['resource_map'])) {
            $container->setParameter('resource.map', $config['resource_map']);
        }
    }
220317
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $processedConfiguration = $this->processConfiguration($configuration, $configs);
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        $this->passConfigurationToOptions($container, $processedConfiguration);

        $container->getDefinition(ClientBuilderInterface::class)
            ->setConfigurator([ClientBuilderConfigurator::class, 'configure']);

        foreach ($processedConfiguration['listener_priorities'] as $key => $priority) {
            $container->setParameter('sentry.listener_priorities.' . $key, $priority);
        }

        $this->tagConsoleErrorListener($container);
    }