Loads the product configuration.

@param array            $configs   An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance
164391
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('block.xml');
        $loader->load('product.xml');
        $loader->load('orm.xml');
        $loader->load('form.xml');
        $loader->load('twig.xml');
        $loader->load('menu.xml');
        $loader->load('serializer.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');
        }

        $pool = $container->getDefinition('sonata.product.pool');
        // this value is altered by the AddProductProviderPass class
        $pool->addMethodCall('__hack', $config['products']);

        $this->registerParameters($container, $config);
        $this->registerDoctrineMapping($config);
        $this->registerSeoParameters($container, $config);
    }
724208
public function load(array $config, ContainerBuilder $container)
    {
        $container->addObjectResource($this);

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

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

        $this->postLoad($config, $container);
    }
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');
        }
    }
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);
    }
786666
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();

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

        // first assemble the adapter factories
        $factoryConfig = new FactoryConfiguration();
        $config        = $processor->processConfiguration($factoryConfig, $configs);
        $factories     = $this->createResolverFactories($config, $container);

        // then normalize the configs
        $configuration = new Configuration($factories);
        $config = $this->processConfiguration($configuration, $configs);

        // create the resolvers
        $resolvers = array();
        foreach ($config['resolvers'] as $fs_name => $resolver) {
            $resolvers[$fs_name] = $this->createResolver($fs_name, $resolver, $container, $factories);
        }
    }
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']);
    }
569975
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('model.xml');
        $loader->load('form.xml');
        $loader->load('helper.xml');
        $loader->load('reader.xml');
        $loader->load('converter.xml');
        $loader->load('loader.xml');
        $loader->load('manager.xml');
        $loader->load('twig_extension.xml');
        $loader->load('validator.xml');
        $loader->load('cache.xml');

        $this->loadRepository($loader, $container, $config);
        $this->loadManager($loader, $container, $config);
        $this->loadRepoClass($loader, $container, $config);
        $this->loadCachePath($container, $config);
        $this->loadVersionEyeKey($container, $config);
    }
769826
public function load(array $configs, ContainerBuilder $containerBuilder)
    {
        // This parameter is unused, but not optional. This line will avoid a static analysis warning this.
        $configs;

        $loader = new YamlFileLoader($containerBuilder, new FileLocator(__DIR__ . '/../../config'));
        $loader->load('services.yml');
    }
1322217
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();

        // first assemble the adapter factories
        $factoryConfig = new FactoryConfiguration();
        $config        = $processor->processConfiguration($factoryConfig, $configs);

        // create a service for each adapter
        $factories     = $this->createAdapterFactories($config, $container);

        // then normalize the configs
        $mainConfig = new Configuration($factories);
        $config     = $processor->processConfiguration($mainConfig, $configs);

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

        $map = array();
        foreach ($config['file_system_list'] as $filesystem => $adapter) {
            $adapterName = array_keys($adapter);
            $adapterName = $adapterName[0];
            $adapterParameter = $adapter[$adapterName];

            if (array_key_exists($adapterName, $factories)) {
                $filesystemId      = sprintf('kitpages_file_system.file_system.%s', $filesystem);
                // create a filesystem service with his adapter
                $factories[$adapterName]->create($container, $filesystemId, $adapterParameter);
;
                $map[$filesystem] = new Reference($filesystemId);
            }


        }

        //allows calls to filesystem services with $this->get('kitpages_file_system.filesystem_map')->getAdapter(filesystemName);
        $container->getDefinition('kitpages_file_system.file_system_map')
            ->replaceArgument(0, $map);
    }
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');
    }
1297229
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $processor = new Processor();

        $config = $processor->processConfiguration($configuration, $configs);
        $container->setParameter('white_october_pagerfanta.default_view', $config['default_view']);

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

        if ($config['exceptions_strategy']['out_of_range_page'] == Configuration::EXCEPTION_STRATEGY_TO_HTTP_NOT_FOUND) {
            $convertListener = $container->getDefinition('pagerfanta.convert_not_valid_max_per_page_to_not_found_listener');
            $convertListener->addTag('kernel.event_subscriber');
        }

        if ($config['exceptions_strategy']['not_valid_current_page'] == Configuration::EXCEPTION_STRATEGY_TO_HTTP_NOT_FOUND) {
            $convertListener = $container->getDefinition('pagerfanta.convert_not_valid_current_page_to_not_found_listener');
            $convertListener->addTag('kernel.event_subscriber');
        }
    }
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);
        }
    }
122263
public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('assetic.xml');
        $loader->load('templating_twig.xml');
        $loader->load('templating_php.xml');

        $def = $container->getDefinition('assetic.parameter_bag');
        if (method_exists($def, 'setFactory')) {
            // to be inlined in assetic.xml when dependency on Symfony DependencyInjection is bumped to 2.6
            $def->setFactory(array(new Reference('service_container'), 'getParameterBag'));
        } else {
            // to be removed when dependency on Symfony DependencyInjection is bumped to 2.6
            $def->setFactoryService('service_container');
            $def->setFactoryMethod('getParameterBag');
        }

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

        $container->setParameter('assetic.debug', $config['debug']);
        $container->setParameter('assetic.use_controller', $config['use_controller']['enabled']);
        $container->setParameter('assetic.enable_profiler', $config['use_controller']['profiler']);
        $container->setParameter('assetic.read_from', $config['read_from']);
        $container->setParameter('assetic.write_to', $config['write_to']);
        $container->setParameter('assetic.variables', $config['variables']);

        $container->setParameter('assetic.java.bin', $config['java']);
        $container->setParameter('assetic.node.bin', $config['node']);
        $container->setParameter('assetic.node.paths', $config['node_paths']);
        $container->setParameter('assetic.ruby.bin', $config['ruby']);
        $container->setParameter('assetic.sass.bin', $config['sass']);
        $container->setParameter('assetic.reactjsx.bin', $config['reactjsx']);

        // register formulae
        $formulae = array();
        foreach ($config['assets'] as $name => $formula) {
            $formulae[$name] = array($formula['inputs'], $formula['filters'], $formula['options']);
        }

        if ($formulae) {
            $container->getDefinition('assetic.config_resource')->replaceArgument(0, $formulae);
        } else {
            $container->removeDefinition('assetic.config_loader');
            $container->removeDefinition('assetic.config_resource');
        }

        // register filters
        foreach ($config['filters'] as $name => $filter) {
            if (isset($filter['resource'])) {
                $loader->load($container->getParameterBag()->resolveValue($filter['resource']));
                unset($filter['resource']);
            } else {
                $loader->load('filters/'.$name.'.xml');
            }

            if (isset($filter['file'])) {
                $container->getDefinition('assetic.filter.'.$name)->setFile($filter['file']);
                unset($filter['file']);
            }

            if (isset($filter['apply_to'])) {
                if (!is_array($filter['apply_to'])) {
                    $filter['apply_to'] = array($filter['apply_to']);
                }

                foreach ($filter['apply_to'] as $i => $pattern) {
                    $worker = new DefinitionDecorator('assetic.worker.ensure_filter');
                    $worker->replaceArgument(0, '/'.$pattern.'/');
                    $worker->replaceArgument(1, new Reference('assetic.filter.'.$name));
                    $worker->addTag('assetic.factory_worker');

                    $container->setDefinition('assetic.filter.'.$name.'.worker'.$i, $worker);
                }

                unset($filter['apply_to']);
            }

            foreach ($filter as $key => $value) {
                $container->setParameter('assetic.filter.'.$name.'.'.$key, $value);
            }
        }

        // twig functions
        $container->setParameter('assetic.twig_extension.functions', $config['twig']['functions']);

        // choose dynamic or static
        if ($useController = $container->getParameterBag()->resolveValue($container->getParameterBag()->get('assetic.use_controller'))) {
            $loader->load('controller.xml');
            $container->getDefinition('assetic.helper.dynamic')->addTag('templating.helper', array('alias' => 'assetic'));
            $container->removeDefinition('assetic.helper.static');
        } else {
            $container->getDefinition('assetic.helper.static')->addTag('templating.helper', array('alias' => 'assetic'));
            $container->removeDefinition('assetic.helper.dynamic');
        }

        $container->setParameter('assetic.bundles', $config['bundles']);

        if ($config['workers']['cache_busting']['enabled']) {
            $container->getDefinition('assetic.worker.cache_busting')->addTag('assetic.factory_worker');
        }
    }
400104
public function load(array $configs, ContainerBuilder $container)
    {
        $ezLoader = new Loader\YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../../lib/eZ/settings')
        );
        $ezLoader->load('fieldtypes.yml');
        $ezLoader->load('fieldtype_services.yml');
        $ezLoader->load('fieldtype_external_storages.yml');
        $ezLoader->load('indexable_fieldtypes.yml');
        $ezLoader->load('storage_engines/legacy/external_storage_gateways.yml');
        $ezLoader->load('storage_engines/legacy/field_value_converters.yml');

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

        // load Kernel BC layer
        $loader->load('bc/aliases.yml');

        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);
        $this->registerRichTextConfiguration($config, $container);
    }
1347055
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        foreach ($config['connections'] as $name => $cacheConfig) {
            $cacheConfig['name'] = $name;
            switch ($cacheConfig['driver']) {
                case 'redis':
                    $this->configureRedisCache($cacheConfig, $container);

                    break;

                case 'memcached':
                case 'memcache':
                    $this->configureMemcachedCache($cacheConfig, $container);

                    break;

                case 'array':
                    $this->configureArrayCache($cacheConfig, $container);

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

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

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

        $registry = $container->getDefinition('uecode_qpush.registry');
        $cache    = $config['cache_service'] ?: 'uecode_qpush.file_cache';

        foreach ($config['queues'] as $queue => $values) {

            // Adds logging property to queue options
            $values['options']['logging_enabled'] = $config['logging_enabled'];

            $provider   = $values['provider'];
            $class      = null;
            $client     = null;

            switch ($config['providers'][$provider]['driver']) {
                case 'aws':
                    $class  = $container->getParameter('uecode_qpush.provider.aws');
                    $client = $this->createAwsClient(
                        $config['providers'][$provider],
                        $container,
                        $provider
                    );
                    break;
                case 'ironmq':
                    $class  = $container->getParameter('uecode_qpush.provider.ironmq');
                    $client = $this->createIronMQClient(
                        $config['providers'][$provider],
                        $container,
                        $provider
                    );
                    break;
                case 'sync':
                    $class  = $container->getParameter('uecode_qpush.provider.sync');
                    $client = $this->createSyncClient();
                    break;
                case 'custom':
                    $class  = $container->getParameter('uecode_qpush.provider.custom');
                    $client = $this->createCustomClient($config['providers'][$provider]['service']);
                    break;
                case 'file':
                    $class = $container->getParameter('uecode_qpush.provider.file');
                    $values['options']['path'] = $config['providers'][$provider]['path'];
                    break;
                case 'doctrine':
                    $class = $container->getParameter('uecode_qpush.provider.doctrine');
                    $client = $this->createDoctrineClient($config['providers'][$provider]);
                    break;
            }

            $definition = new Definition(
                $class, [$queue, $values['options'], $client, new Reference($cache), new Reference('logger')]
            );

            $definition->setPublic(true);

            $definition->addTag('monolog.logger', ['channel' => 'qpush'])
                ->addTag(
                    'uecode_qpush.event_listener',
                    [
                        'event' => "{$queue}.on_notification",
                        'method' => "onNotification",
                        'priority' => 255
                    ]
                )
                ->addTag(
                    'uecode_qpush.event_listener',
                    [
                        'event' => "{$queue}.message_received",
                        'method' => "onMessageReceived",
                        'priority' => -255
                    ]
                );

            $isProviderAWS = $config['providers'][$provider]['driver'] === 'aws';
            $isQueueNameSet = isset($values['options']['queue_name']) && !empty($values['options']['queue_name']);

            if ($isQueueNameSet && $isProviderAWS) {
                $definition->addTag(
                    'uecode_qpush.event_listener',
                    [
                        'event' => "{$values['options']['queue_name']}.on_notification",
                        'method' => "onNotification",
                        'priority' => 255
                    ]
                );

                // Check queue name ends with ".fifo"
                $isQueueNameFIFOReady = preg_match("/$(?<=(\.fifo))/", $values['options']['queue_name']) === 1;
                if ($values['options']['fifo'] === true && !$isQueueNameFIFOReady) {
                    throw new InvalidArgumentException('Queue name must end with ".fifo" on AWS FIFO queues');
                }
            }

            $name = sprintf('uecode_qpush.%s', $queue);
            $container->setDefinition($name, $definition);

            $registry->addMethodCall('addProvider', [$queue, new Reference($name)]);
        }
    }
978430
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

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

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

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

        $container->register('security.auth_failure_subscriber', 'Nice\Security\AuthenticationFailureSubscriber')
            ->addTag('kernel.event_subscriber');
    }