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
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']);
    }
1096484
protected function loadInternal(array $configs, ContainerBuilder $container)
    {
        $parameters = $this->flattenParametersFromConfig($container, $configs, 'vm_pro_api');
        foreach ($parameters as $key => $value) {
            $container->setParameter($key, $value);
        }

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

        // Always load the services that will always be the same
        $loader->load('services/main.yml');

        // only load ratings service if the meta data fields are configured
        if (array_key_exists('vm_pro_api_rating_meta_data_fields_average', $parameters)
            && array_key_exists('vm_pro_api_rating_meta_data_fields_count', $parameters)) {
            $loader->load('services/ratings.yml');
        }

        // Dynamically load service configurations that are specific
        // to which Guzzle version is installed
        if (version_compare(ClientInterface::VERSION, '6.0', '>=')) {
            $loader->load('services/guzzle6.yml');
        } else {
            $loader->load('services/guzzle5.yml');
        }

        if (version_compare(Kernel::VERSION, '3.3', '>=')) {
            $loader->load('services/symfony3.yml');
        }
    }
550234
protected function loadConfiguration(ContainerBuilder $container, array $config)
    {
        $container->setParameter('jb_fileuploader.endpoints', $config);
        $container->setParameter('jb_fileuploader.crop_route', $config['crop_route']);
    }
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', []);
        }
    }
380503
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('account.xml');
        $loader->load('api.xml');

        if ($config['ade_accounts']) {
            $this->loadAdeAccounts($container, $config['ade_accounts']);
        }

        if (isset($config['track_accounts'])) {
            $this->loadTrackAccounts($container, $config['track_accounts']);
        }
    }
1019759
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $filesystem = new Filesystem();
        $filesystem->mkdir($config['storage']['local_directory']);

        $container->setParameter('nanbando.name', $config['name']);
        $container->setParameter('nanbando.environment', $config['environment']);
        $container->setParameter('nanbando.application.name', $config['application']['name']);
        $container->setParameter('nanbando.application.version', $config['application']['version']);
        $container->setParameter('nanbando.application.options', $config['application']['options']);
        $container->setParameter('nanbando.temp', $config['temp']);
        $container->setParameter('nanbando.backup', $config['backup']);
        $container->setParameter('nanbando.presets', $config['presets']);
        $container->setParameter('nanbando.servers', $config['servers']);
        $container->setParameter('nanbando.storage.local_directory', realpath($config['storage']['local_directory']));

        if (array_key_exists('remote_service', $config['storage'])
            && $config['storage']['remote_service'] !== 'filesystem.remote'
        ) {
            $container->setAlias('filesystem.remote', $config['storage']['remote_service']);
        }

        $container->prependExtensionConfig(
            'oneup_flysystem',
            [
                'adapters' => [
                    'local' => [
                        'local' => [
                            'directory' => $container->getParameter('nanbando.storage.local_directory'),
                        ],
                    ],
                ],
                'filesystems' => [
                    'local' => [
                        'adapter' => 'local',
                        'alias' => 'filesystem.local',
                        'plugins' => ['filesystem.list_files'],
                    ],
                ],
            ]
        );

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');
        $loader->load('event-listener.xml');
        $loader->load('local-commands.xml');
        $loader->load('ssh-commands.xml');

        // ensure container rebuild after puli bindings changes
        $puliFile = Path::join([getcwd(), NANBANDO_DIR, '.puli']);
        if (file_exists($puliFile)) {
            $container->addResource(new FileResource($puliFile));
        }
    }
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));
    }
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');
    }
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);
        }
    }
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);
    }
1353242
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();

        $reflectionObject = new \ReflectionObject($this);
        $loader = new Loader\XmlFileLoader($container, new FileLocator(dirname($reflectionObject->getFileName()).'/../Resources/config'));

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

        $parameterBuilder = new ParameterBuilder($container);
        $parameterBuilder->build(Constants::ROOT_PARAMETER, $config);

        $this->loadXmlServices($loader);

        if (Driver::BOTH === $container->getParameter(Constants::ROOT_PARAMETER.'.admin.driver')) {
            $container->setParameter(Constants::ROOT_PARAMETER.'.admin.backend_type_orm', true);
            $container->setParameter(Constants::ROOT_PARAMETER.'.admin.backend_type_odm', true);

            $loader->load('orm.xml');
            $loader->load('odm.xml');
        } else {
            $driver = $container->getParameter(Constants::ROOT_PARAMETER.'.admin.driver');
            $container->setParameter(Constants::ROOT_PARAMETER.'.admin.backend_type_'.$driver, true);

            $loader->load($driver.'.xml');
        }
    }
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');
    }
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',
        ));
    }
1149111
public function load(array $configs, ContainerBuilder $container)
    {
        parent::load($configs, $container);

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

        $dataGridRegistry = $container->getDefinition(DataGridRegistry::class);
        foreach ((array) $this->globalConfiguration['configurations'] as $code => $dataGridConfiguration) {
            $dataGridConfiguration = $this->finalizeConfiguration($code, $dataGridConfiguration);
            $dataGridRegistry->addMethodCall('addRawDataGridConfiguration', [$code, $dataGridConfiguration]);
        }
    }
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'));
    }
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);
        }
    }
23689
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

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

        $this->registerWorkflowConfiguration($config['workflows'], $container, $loader);
    }