Loads a specific configuration.

@param array            $configs   An array of configuration values
@param ContainerBuilder $container A ContainerBuilder instance

@throws InvalidArgumentException When provided tag is not defined in this extension
763790
public function load(array $configs, ContainerBuilder $container)
    {
        $container->setParameter('version_checker.url', 'https://bundles.kunstmaan.be/version-check');
        $container->setParameter('version_checker.timeframe', 60 * 60 * 24);
        $container->setParameter('version_checker.enabled', true);

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

        if (array_key_exists('dashboard_route', $config)) {
            $container->setParameter('kunstmaan_admin.dashboard_route', $config['dashboard_route']);
        }
        if (array_key_exists('admin_password', $config)) {
            $container->setParameter('kunstmaan_admin.admin_password', $config['admin_password']);
        }
        $container->setParameter('kunstmaan_admin.admin_locales', $config['admin_locales']);
        $container->setParameter('kunstmaan_admin.default_admin_locale', $config['default_admin_locale']);

        $container->setParameter('kunstmaan_admin.session_security.ip_check', $config['session_security']['ip_check']);
        $container->setParameter('kunstmaan_admin.session_security.user_agent_check', $config['session_security']['user_agent_check']);

        $container->setParameter('kunstmaan_admin.admin_prefix', $this->normalizeUrlSlice($config['admin_prefix']));

        $container->setParameter('kunstmaan_admin.admin_exception_excludes', $config['admin_exception_excludes']);

        $container->setParameter('kunstmaan_admin.google_signin.enabled', $config['google_signin']['enabled']);
        $container->setParameter('kunstmaan_admin.google_signin.client_id', $config['google_signin']['client_id']);
        $container->setParameter('kunstmaan_admin.google_signin.client_secret', $config['google_signin']['client_secret']);
        $container->setParameter('kunstmaan_admin.google_signin.hosted_domains', $config['google_signin']['hosted_domains']);

        $container->setParameter('kunstmaan_admin.password_restrictions.min_digits', $config['password_restrictions']['min_digits']);
        $container->setParameter('kunstmaan_admin.password_restrictions.min_uppercase', $config['password_restrictions']['min_uppercase']);
        $container->setParameter('kunstmaan_admin.password_restrictions.min_special_characters', $config['password_restrictions']['min_special_characters']);
        $container->setParameter('kunstmaan_admin.password_restrictions.min_length', $config['password_restrictions']['min_length']);
        $container->setParameter('kunstmaan_admin.password_restrictions.max_length', $config['password_restrictions']['max_length']);
        $container->setParameter('kunstmaan_admin.enable_toolbar_helper', $config['enable_toolbar_helper']);
        $container->setParameter('kunstmaan_admin.toolbar_firewall_names', !empty($config['provider_keys']) ? $config['provider_keys'] : $config['toolbar_firewall_names']);
        $container->setParameter('kunstmaan_admin.admin_firewall_name', $config['admin_firewall_name']);

        $container->registerForAutoconfiguration(MenuAdaptorInterface::class)
            ->addTag('kunstmaan_admin.menu.adaptor');

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

        if (!empty($config['enable_console_exception_listener']) && $config['enable_console_exception_listener']) {
            $loader->load('console_listener.yml');
        }

        if (0 !== count($config['menu_items'])) {
            $this->addSimpleMenuAdaptor($container, $config['menu_items']);
        }

        $this->addWebsiteTitleParameter($container, $config);
        $this->addMultiLanguageParameter($container, $config);
        $this->addRequiredLocalesParameter($container, $config);
        $this->addDefaultLocaleParameter($container, $config);
    }
431013
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('services.xml');
        $loader->load('commands.xml');

        $container->setParameter('ecommit_util.clear_apcu.url', $config['clear_apcu']['url']);
        $container->setParameter('ecommit_util.clear_apcu.username', $config['clear_apcu']['username']);
        $container->setParameter('ecommit_util.clear_apcu.password', $config['clear_apcu']['password']);

        $container->setParameter('ecommit_util.install_lock_file', $config['install_lock_file']);

        foreach ($config['cache'] as $name => $options) {
            $serviceName = sprintf('ecommit_cache_%s', $name);
            $container
                ->setDefinition($serviceName, new ChildDefinition('ecommit_util.cache'))
                ->replaceArgument(0, $options)
                ->setPublic(true);
        }
    }
406328
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' ) );
        $loader->load( 'services.yml' );

        //Services to use are stored as parameters and will be processes by Compiler\ServiceAliasesPass
        $container->setParameter( self::FACADE_SERVICE_ID, $config['facade'] );
        $container->setParameter( self::FORM_PROVIDER_SERVICE_ID, $config['providers']['form'] );
        $container->setParameter( self::HANDLER_PROVIDER_SERVICE_ID, $config['providers']['handler'] );
        $container->setParameter( self::RESPONSE_PROVIDER_SERVICE_ID, $config['providers']['response'] );
    }
1012961
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new FlowConfiguration();
        $processor = new Processor();
        $this->flowsConfig = $processor->processConfiguration($configuration, $configs);
    }
18290
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('templating', 'Symfony\Component\Templating\DelegatingEngine');
        $container->register('templating.template_name_parser', 'Symfony\Component\Templating\TemplateNameParser');

        if (true === $config['enable_php_engine']) {
            $container->setParameter('php.template_dir', $config['template_dir']);

            $container->register('templating.engine.php.loader', 'Symfony\Component\Templating\Loader\FilesystemLoader')
                ->setPublic(false)
                ->addArgument('%php.template_dir%/%%name%%');
            $container->register('templating.engine.php.helper.slots', 'Symfony\Component\Templating\Helper\SlotsHelper');
            $container->register('templating.engine.php.helper.assets', 'Nice\Templating\Helper\AssetsHelper')
                ->addArgument(new Reference('service_container'));
            $container->register('templating.engine.php.helper.router', 'Nice\Templating\Helper\RouterHelper')
                ->addArgument(new Reference('service_container'));
            $container->register('templating.engine.php', 'Symfony\Component\Templating\PhpEngine')
                ->addArgument(new Reference('templating.template_name_parser'))
                ->addArgument(new Reference('templating.engine.php.loader'))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.slots')))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.assets')))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.router')))
                ->addTag('templating.engine');
        }
    }
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);
    }
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');
    }
1310150
public function load(array $configs, ContainerBuilder $container)
    {
        $container->setDefinition('urodoz_truncate', new Definition('Urodoz\Truncate\TruncateService'));
        $container->setDefinition(
            'urodoz_truncate.twig.truncateHTML',
            new Definition(
                'Urodoz\Truncate\Bridge\Twig\TruncateExtension',
                array(new Reference('urodoz_truncate'))
            )
        )->addTag('twig.extension');
    }
79374
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();

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

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

        $container->setParameter('twig.form.resources', array_merge(
            $container->getParameter('twig.form.resources'),
            ['VictoireMediaBundle:Form:formWidgets.html.twig']
        ));

        $loader->load('services.yml');
        $loader->load('handlers.yml');
    }
901566
public function load(array $configs, ContainerBuilder $container)
    {
        $config = $this->processConfiguration(new Configuration(), $configs);

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

        // Make sure config values are in the parameters
        foreach (['router', 'session', 'doctrine', 'logging', 'annotation', 'serializer', 'validation'] as $section) {
            if ($config[$section]['enabled']) {
                $container->setParameter('cache.'.$section, $config[$section]);
            }
        }

        if ($config['doctrine']['enabled']) {
            $this->verifyDoctrineBridgeExists('doctrine');
        }

        $this->registerServices($container, $config);

        // Add toolbar and data collector if we are debugging
        if (!isset($config['data_collector']['enabled'])) {
            $config['data_collector']['enabled'] = $container->getParameter('kernel.debug');
        }

        if ($config['data_collector']['enabled']) {
            $loader->load('data-collector.yml');
        }

        // Get a list of the psr-6 services we are using.
        $serviceIds = [];
        $this->findServiceIds($config, $serviceIds);
        $container->setParameter('cache.provider_service_ids', $serviceIds);

        $container->register(CacheFlushCommand::class, CacheFlushCommand::class)
            ->addTag('console.command', ['command' => 'cache:flush']);
    }
826611
private function loadConfig(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $processedConfiguration = $this->processConfiguration($configuration, $configs);

        foreach ($processedConfiguration as $key => $value) {
            $container->setParameter(
                $this->getAlias().'.'.$key,
                $value
            );
        }
    }
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));
        }
    }
765017
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('doctrine.dbal.configuration', 'Doctrine\DBAL\Configuration');

        $container->register('doctrine.dbal.database_connection', 'Doctrine\DBAL\Connection')
            ->setFactoryClass('Doctrine\DBAL\DriverManager')
            ->setFactoryMethod('getConnection')
            ->addArgument($config['database'])
            ->addArgument(new Reference('doctrine.dbal.configuration'));
    }
131747
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);
        $this->globalConfig = $config;

        $container->setParameter('sidus_eav_model.entity.data.class', $config['data_class']);
        $container->setParameter('sidus_eav_model.entity.value.class', $config['value_class']);
        $container->setParameter('sidus_eav_model.form.collection_type', $config['collection_type']);
        $container->setParameter('sidus_eav_model.context.form_type', $config['context_form_type']);
        $container->setParameter('sidus_eav_model.context.default_context', $config['default_context']);
        $container->setParameter('sidus_eav_model.context.global_mask', $config['global_context_mask']);

        // Injecting custom doctrine type
        $doctrineTypes = $container->getParameter('doctrine.dbal.connection_factory.types');
        $doctrineTypes['sidus_family'] = ['class' => FamilyType::class, 'commented' => true];
        $container->setParameter('doctrine.dbal.connection_factory.types', $doctrineTypes);

        // Load services config
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/services'));
        $loader->load('attribute_types.yml');
        $loader->load('configuration.yml');
        $loader->load('context.yml');
        $loader->load('debug.yml');
        $loader->load('deprecated.yml');
        $loader->load('doctrine.yml');
        $loader->load('entities.yml');
        $loader->load('events.yml');
        $loader->load('forms.yml');
        $loader->load('manager.yml');
        $loader->load('param_converters.yml');
        $loader->load('twig.yml');
        $loader->load('validators.yml');

        if ($config['serializer_enabled']) {
            // Only load normalizers if symfony serializer is loaded
            $loader->load('serializer.yml');
            $loader->load('normalizer.yml');
            $loader->load('denormalizer.yml');
            $loader->load('deprecated_serializer.yml');
        }

        // The DatagridBundle might be installed
        /** @noinspection PhpUndefinedClassInspection */
        if (interface_exists(RenderableInterface::class)) {
            $loader->load('datagrid.yml');
        }
        /** @noinspection PhpUndefinedClassInspection */
        if (interface_exists(ColumnValueRendererInterface::class)) {
            $loader->load('datagrid-v2.yml');
        }

        // Add global attribute configuration to handler
        $attributeConfiguration = $container->getDefinition(AttributeRegistry::class);
        $attributeConfiguration->addMethodCall('parseGlobalConfig', [$config['attributes']]);

        $this->createFamilyServices($config, $container);
    }
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);
    }
1288962
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('mustache.xml');

        foreach ($configs as &$config) {
            if (isset($config['globals'])) {
                foreach ($config['globals'] as $name => $value) {
                    if (is_array($value) && isset($value['key'])) {
                        $config['globals'][$name] = array(
                            'key'   => $name,
                            'value' => $config['globals'][$name],
                        );
                    }
                }
            }
        }

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

        $def = $container->getDefinition('mustache');

        if (isset($config['loader_id'])) {
            $loader = new Reference($config['loader_id']);
        } else {
            $loader = new Reference('mustache.loader');
        }
        $def->addMethodCall('setLoader', array($loader));

        if (isset($config['partials_loader_id'])) {
            $partialsLoader = new Reference($config['partials_loader_id']);
        } else {
            $partialsLoader = $loader;
        }
        $def->addMethodCall('setPartialsLoader', array($partialsLoader));

        if (!empty($config['globals'])) {
            $def = $container->getDefinition('mustache');
            foreach ($config['globals'] as $key => $global) {
                if (isset($global['type']) && 'service' === $global['type']) {
                    $def->addMethodCall('addHelper', array($key, new Reference($global['id'])));
                } else {
                    $def->addMethodCall('addHelper', array($key, $global['value']));
                }
            }
        }
        unset($config['globals'], $config['loader_id'], $config['partials_loader_id']);
        $container->setParameter('mustache.options', $config);

        $this->addClassesToCompile(array(
            'Mustache_Context',
            'Mustache_HelperCollection',
            'Mustache_Loader',
            'Mustache_Loader_FilesystemLoader',
            'Mustache_Engine',
            'Mustache_Template',
        ));
    }
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);
        }
    }