@param array $configs
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container

@throws \Exception
172156
public function load(array $configs, ContainerBuilder $container)
    {
        $activatedBundlesMap = $container->getParameter('kernel.bundles');

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

        if (array_key_exists('EzPublishLegacySearchEngineBundle', $activatedBundlesMap)) {
            $loader->load('search/legacy.yml');
        }

        if (array_key_exists('EzSystemsEzPlatformSolrSearchEngineBundle', $activatedBundlesMap)) {
            $loader->load('search/solr.yml');
        }

        $loader->load('search/common.yml');
        $loader->load('persistence.yml');

        $this->processExtensionConfiguration($configs, $container);
    }
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']);
    }
639283
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $this->config = $this->processConfiguration($configuration, $configs);

        foreach (ServicesFactory::getAvailableServices() as $service) {
            $serviceKey = StringUtil::camelcaseToUnderscore($service);
            $definition = new Definition('Aws\\'.$service.'\\'.$service.'Client', array($this->getConfig($serviceKey)));
            $definition->setPublic(true);
            $container->setDefinition('aws.'.$serviceKey, $definition);
        }
    }
382820
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);


        if (isset($config['handlers'])) {
            $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
            $loader->load('monolog.xml');

            $container->setParameter('monolog.use_microseconds', $config['use_microseconds']);

            // always autowire the main logger, require Symfony >= 2.8, < 3.3
            if (!method_exists('Symfony\Component\DependencyInjection\ContainerBuilder', 'fileExists') && method_exists('Symfony\Component\DependencyInjection\Definition', 'addAutowiringType')) {
                $container->getDefinition('monolog.logger')->addAutowiringType('Psr\Log\LoggerInterface');
            }

            $handlers = array();

            foreach ($config['handlers'] as $name => $handler) {
                $handlers[$handler['priority']][] = array(
                    'id' => $this->buildHandler($container, $name, $handler),
                    'channels' => empty($handler['channels']) ? null : $handler['channels'],
                );
            }

            $container->setParameter(
                'monolog.swift_mailer.handlers',
                $this->swiftMailerHandlers
            );

            ksort($handlers);
            $sortedHandlers = array();
            foreach ($handlers as $priorityHandlers) {
                foreach (array_reverse($priorityHandlers) as $handler) {
                    $sortedHandlers[] = $handler;
                }
            }

            $handlersToChannels = array();
            foreach ($sortedHandlers as $handler) {
                if (!in_array($handler['id'], $this->nestedHandlers)) {
                    $handlersToChannels[$handler['id']] = $handler['channels'];
                }
            }
            $container->setParameter('monolog.handlers_to_channels', $handlersToChannels);

            if (PHP_VERSION_ID < 70000) {
                $this->addClassesToCompile(array(
                    'Monolog\\Formatter\\FormatterInterface',
                    'Monolog\\Formatter\\LineFormatter',
                    'Monolog\\Handler\\HandlerInterface',
                    'Monolog\\Handler\\AbstractHandler',
                    'Monolog\\Handler\\AbstractProcessingHandler',
                    'Monolog\\Handler\\StreamHandler',
                    'Monolog\\Handler\\FingersCrossedHandler',
                    'Monolog\\Handler\\FilterHandler',
                    'Monolog\\Handler\\TestHandler',
                    'Monolog\\Logger',
                    'Symfony\\Bridge\\Monolog\\Logger',
                    'Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface',
                    'Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy',
                ));
            }
        }

        $container->setParameter('monolog.additional_channels', isset($config['channels']) ? $config['channels'] : array());
    }
210209
private function configurePlugins(ContainerBuilder $container, array $config)
    {
        if (!empty($config['authentication'])) {
            $this->configureAuthentication($container, $config['authentication']);
        }
        unset($config['authentication']);

        foreach ($config as $name => $pluginConfig) {
            $pluginId = 'httplug.plugin.'.$name;

            if ($this->isConfigEnabled($container, $pluginConfig)) {
                $def = $container->getDefinition($pluginId);
                $this->configurePluginByName($name, $def, $pluginConfig, $container, $pluginId);
            }
        }
    }
1337007
public function load(array $configs, ContainerBuilder $container): void
    {
        $configuration = new Configuration($this->getAlias());
        $this->processConfiguration($configuration, $configs);

        foreach (Iter::makeOneDimension($configs[0], self::ALIAS) as $key => $value) {
            $container->setParameter($key, $value);
        }
    }
1258555
public function load(array $configs, ContainerBuilder $container): void
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

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

        // If the search bundle is active register search services.
        $bundles = $container->getParameter('kernel.bundles');
        if (isset($bundles['BkstgSearchBundle'])) {
            $loader->load('services.search.yml');
        }
        $this->configureFilesystemAdapter($container, $config);
        $this->configureCdnAdapter($container, $config);
    }
416297
protected function setConfigParameters(array $configs, ContainerBuilder $container): void
    {
        foreach ($this->getConfigParameters() as $parameter) {
            $keys = explode('.', $parameter);
            $value = $configs;
            foreach ($keys as $key) {
                $value = $value[$key];
            }
            $container->setParameter($this->getAlias().'.'.$parameter, $value);
        }
    }
982322
public function load(array $configs, ContainerBuilder $container)
    {
        $activatedBundles = array_keys($container->getParameter('kernel.bundles'));

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

        $coreFileLocator = new FileLocator(__DIR__ . '/../../lib/Resources/config');
        $coreLoader = new Loader\YamlFileLoader($container, $coreFileLocator);
        $coreLoader->load('services.yml');

        if (in_array('NetgenTagsBundle', $activatedBundles, true)) {
            $coreLoader->load('query_types/netgen_tags_dependant.yml');
        }

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

        $processor = new ConfigurationProcessor($container, $this->getAlias());
        $processor->mapConfig(
            $config,
            function ($scopeSettings, $currentScope, ContextualizerInterface $contextualizer) {
                foreach ($scopeSettings as $key => $value) {
                    $contextualizer->setContextualParameter($key, $currentScope, $value);
                }
            }
        );

        if (!$container->hasParameter('ezsettings.default.ngcontent_view')) {
            // Default value for ngcontent_view template rules
            // Setting this through the config file causes issues in eZ kernel 6.11+
            $container->setParameter('ezsettings.default.ngcontent_view', []);
        }
    }
515466
public function load(array $configs, ContainerBuilder $container)
    {
        array_unshift($configs, [
            'files' => [
                'web' => [
                    'directory' => $container->getParameter('kernel.root_dir') . '/../web',
                    'exclude' => '*.php',
                ]
            ],
            'routes' => [
                'pages' => [
                    'route' => '_slug',
                    'generator' => 'nodes',
                ],
                'sitemap_index' => [
                    'route' => 'KunstmaanSitemapBundle_sitemapindex',
                    'defaults' => [
                        '_format' => 'xml',
                    ]
                ],
                'sitemaps' => [
                    'route' => 'KunstmaanSitemapBundle_sitemap',
                    'generator' => 'locales',
                    'defaults' => [
                        '_format' => 'xml',
                    ]
                ],
                'robots' => [
                    'route' => 'KunstmaanSeoBundle_robots',
                ]
            ],
            'extensions' => [
                "css" => "text/css",
                "js" => "text/javascript",
                "svg" => "image/svg+xml",
                "map" => "application/json",
                "jpg" => "image/jpeg",
                "jpeg" => "image/jpeg",
                "png" => "image/png",
                "ttf" => "font/ttf",
                "otf" => "application/x-font-opentype",
                "woff" => "application/font-woff",
                "woff2" => "application/font-woff2",
                "eot" => "application/vnd.ms-fontobject",
            ]
        ]);

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

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

        $container->setParameter('nassau.static_site.url_prefix', $configs['url_prefix']);
        $container->setParameter('nassau.static_site.extensions', $configs['extensions']);
        $this->configureRoutes($container, $configs['routes']);
        $this->configureFiles($container, $configs['files']);
    }
624652
public function load(array $configs , ContainerBuilder $container)
    {
        $configuration = new Configuration();

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

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('parser.xml');
        // BC to support the PHP templates in the Templating component
        if (interface_exists(EngineInterface::class)) {
            $loader->load('helper.xml');
        }
        $loader->load('twig.xml');

        if ('markdown.parser.sundown' == $config['parser']['service']) {
            if (!class_exists('Sundown\\Markdown')) {
                throw new InvalidConfigurationException('Sundown parser selected, but required extension is not installed or configured.');
            }

            $loader->load('sundown.xml');

            $definition = $container->getDefinition('markdown.parser.sundown');
            $definition->addTag('markdown.parser', array('alias' => 'sundown'));

            $container->setParameter('markdown.sundown.extensions', $config['sundown']['extensions']);
            $container->setParameter('markdown.sundown.render_flags', $config['sundown']['render_flags']);
        }

        $container->setAlias('markdown.parser', new Alias($config['parser']['service'], true));
        $container->setAlias(MarkdownParserInterface::class, 'markdown.parser');
        $container->setAlias(MarkdownInterface::class, 'markdown.parser');
    }
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']);
    }
712938
public function load(array $configs, ContainerBuilder $builder)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($builder, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yaml');
        $loader->load('services/factories.yaml');
        $loader->load('services/fields.yaml');
        $loader->load('services/resources.yaml');
        $loader->load('services/subscribers.yaml');
        $loader->load('services/twig.yaml');

        if ('dev' === $builder->getParameter('kernel.environment')) {
            $loader->load('services_dev.yaml');
        }
        $applicationConfig = [];
        $adminsConfig = [];
        $menusConfig = [];
        $enableExtraConfig = true;

        if (key_exists('application', $config)) {
            if (key_exists('enable_extra_configuration', $config['application'])) {
                $enableExtraConfig = $config['application']['enable_extra_configuration'];
            }
            $applicationConfig = $config['application'];
        }

        if (key_exists('admins', $config)) {
            $adminsConfig = $config['admins'];
        }

        if (key_exists('menus', $config)) {
            $menusConfig = $config['menus'];

            foreach ($menusConfig as $name => $menu) {
                if (null === $menu) {
                    $menusConfig[$name] = [];
                }
            }
        }
        $builder->setParameter('lag.admin.enable_extra_configuration', $enableExtraConfig);
        $builder->setParameter('lag.admin.application_configuration', $applicationConfig);
        $builder->setParameter('lag.admins', $adminsConfig);
        $builder->setParameter('lag.menus', $menusConfig);
    }
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);
    }
815738
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $defaults = Yaml::parseFile(__DIR__.'/../Resources/config/cms/config.yml');

        foreach ($configs as $config) {
            foreach ($config as $key => $value) {
                $defaults['networking_init_cms'][ $key ] = $value;
            }
        }

        $config = $this->processConfiguration($configuration, $defaults);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('blocks.xml');
        $loader->load('event_listeners.xml');
        $loader->load('forms.xml');
        $loader->load('menus.xml');
        $loader->load('twig.xml');
        $loader->load('services.xml');
        $loader->load('validators.xml');

        //mongodb is not yet fully supported but will come (eventually)
        if ('custom' !== $config['db_driver']) {
            $loader->load(sprintf('doctrine_%s.xml', $config['db_driver']));
            $loader->load(sprintf('ext_admin_%s.xml', $config['db_driver']));
            $loader->load(sprintf('admin_%s.xml', $config['db_driver']));
        }

        $config['languages'] = $this->addShortLabels($config['languages']);

        $container->setParameter('networking_init_cms.page.languages', $config['languages']);
        $container->setParameter('networking_init_cms.page.templates', $config['templates']);
        $container->setParameter('networking_init_cms.page.content_types', $config['content_types']);
        $container->setParameter(
            'networking_init_cms.translation_fallback_route',
            $config['translation_fallback_route']
        );
        $container->setParameter(
            'networking_init_cms.multiple_media_tags',
            $config['multiple_media_tags']
        );
        $container->setParameter(
            'networking_init_cms.show_tag_tree',
            $config['show_tag_tree']
        );

        if (!$config['admin_toolbar']['toolbar']) {
            $mode = AdminToolbarSubscriber::DISABLED;
        } else {
            $mode = AdminToolbarSubscriber::ENABLED;
        }
        $container->setParameter('networking_init_cms.admin_toolbar.mode', $mode);
        $container->setParameter('networking_init_cms.admin_toolbar.position', $config['admin_toolbar']['position']);

        $container->setParameter('networking_init_cms.404_template', $config['404_template']);
        $container->setParameter('networking_init_cms.no_translation_template', $config['no_translation_template']);
        $container->setParameter('networking_init_cms.admin_menu_groups', $config['admin_menu_groups']);
        $container->setParameter('networking_init_cms.db_driver', $config['db_driver']);

        if ($config['db_driver'] == 'orm') {
            $this->registerDoctrineORMMapping($config);
        }

        $container->setParameter('networking_init_cms.cache.activate', $config['cache']['activate']);
        $container->setParameter('networking_init_cms.cache.cache_time', $config['cache']['cache_time']);
        $cacheClass = $config['cache']['cache_service_class'];
        $reflectionClass = new \ReflectionClass($cacheClass);

        $container->setParameter('networking_init_cms.xml_sitemap.sitemap_url', $config['xml_sitemap']['sitemap_url']);
        $container->setParameter('networking_init_cms.xml_sitemap.additional_links', $config['xml_sitemap']['additional_links']);

        if (in_array('Networking\InitCmsBundle\Lib\PhpCacheInterface', $reflectionClass->getInterfaceNames())) {
            $container->setParameter('networking_init_cms.lib.php_cache.class', $config['cache']['cache_service_class']);
        } else {
            throw new InvalidParameterException('Cache class should implement the PhpCacheInterface interface');
        }
        $this->configureLanguageCookie($config, $container);

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

        foreach (array('themes', 'active_theme', 'path_patterns', 'cache_warming') as $key) {
            $container->setParameter($this->getAlias().'.'.$key, $config[$key]);
        }

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

        $options = null;
        if (!empty($config['cookie']['name'])) {
            $options = array();
            foreach (array('name', 'lifetime', 'path', 'domain', 'secure', 'http_only') as $key) {
                $options[$key] = $config['cookie'][$key];
            }
        }
        $container->setParameter($this->getAlias().'.cookie', $options);

        if (!empty($config['cookie']['name']) || (true == $config['autodetect_theme'])) {
            $loader->load('theme_request_listener.xml');
        }

        if ($config['theme_specific_controllers']) {
            $loader->load('theme_controller_listener.xml');
        }

        if (true == $config['load_controllers']) {
            $loader->load('controller.xml');
        }

        if (!empty($config['cookie']['name'])) {
            $container->getDefinition($this->getAlias().'.theme_request_listener')
                ->addTag('kernel.event_listener', array('event' => 'kernel.response', 'method' => 'onKernelResponse'));
        }

        if (!empty($config['device_detection'])) {
            $container->setAlias('liip_theme.theme_auto_detect', $config['device_detection']);
        }

        if (!empty($config['autodetect_theme'])) {
            // @FIXME for 2.0 we should make 'autodetect_theme' a boolean only
            $id = is_string($config['autodetect_theme']) ? $config['autodetect_theme'] : 'liip_theme.theme_auto_detect';

            $container->getDefinition($this->getAlias().'.theme_request_listener')
                ->addArgument(new Reference($id));
        }

        if (true === $config['assetic_integration']) {
            $container->setParameter('liip_theme.assetic_integration', true);
        }

        $loader->load('templating.xml');
    }
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));
    }