@param $config
@param ContainerBuilder $container

@throws \InvalidArgumentException
766197
public function configureClass($config, ContainerBuilder $container)
    {
        // admin configuration
        $container->setParameter('networking_init_cms.admin.page.class', $config['class']['page']);
        $container->setParameter('networking_init_cms.admin.layout_block.class', $config['class']['layout_block']);
        $container->setParameter('networking_init_cms.admin.user.class', $config['class']['user']);

        // manager configuration
        $container->setParameter('networking_init_cms.manager.page.class', $config['class']['page']);
        $container->setParameter('networking_init_cms.manager.layout_block.class', $config['class']['layout_block']);
        $container->setParameter('networking_init_cms.manager.user.class', $config['class']['user']);

        switch ($config['db_driver']) {
            case 'orm':
                $container->setParameter('networking_init_cms.admin.layout_block.class', 'Networking\InitCmsBundle\Entity\LayoutBlock');
                break;
            case 'mongodb':
                $container->setParameter('networking_init_cms.admin.layout_block.class', 'Networking\InitCmsBundle\Docment\LayoutBlock');
                break;
            default:
                throw new \InvalidArgumentException('db driver must be either orm or mongodb');
                break;
        }
    }
769095
protected function loadRepository($loader, ContainerBuilder $container, array $config)
    {
        if (isset($config['repository']['type'])) {
            if ($config['repository']['type'] == 'yaml') {
                if (!isset($config['repository']['repo']['filename'])) {
                    throw new InvalidConfigurationException(
                        'You must define filename parameter for repo yaml repository'
                    );
                }
                $container->setParameter(
                    'snide_travinizer.repo_repository.filename',
                    $config['repository']['repo']['filename']
                );
            }

            $loader->load('repository/' . strtr($config['repository']['type'], '_', '/') . '.xml');
        } else {
            throw new InvalidConfigurationException('You must define repository type parameter');
        }

        if (isset($config['repository']['class'])) {
            $container->setParameter('snide_travinizer.repo_repository.class', $config['repository']['class']);
        }
    }
504908
private function loadParameters(ContainerBuilder $container, array $config)
    {
        // Store config in parameters array to be passed into the DrupalContext.
        $drupal_parameters = array();
        foreach ($config as $key => $value) {
            $drupal_parameters[$key] = $value;
        }
        $container->setParameter('drupal.parameters', $drupal_parameters);

        $container->setParameter('drupal.region_map', $config['region_map']);
    }
582961
private function applyMappingParametrization(
        array $config,
        ContainerBuilder $container
    ) {
        if (!$this->mappingBagProvider instanceof MappingBagProvider) {
            return;
        }

        $mappingBagCollection = $this
            ->mappingBagProvider
            ->getMappingBagCollection();

        $mappedParameters = [];
        foreach ($mappingBagCollection->all() as $mappingBag) {
            $entityName = $mappingBag->getEntityName();
            $isOverwritable = $mappingBag->isOverwritable();
            $mappedParameters = array_merge($mappedParameters, [
                $mappingBag->getParamFormat('class') => $isOverwritable
                    ? $config['mapping'][$entityName]['class']
                    : $mappingBag->getEntityNamespace(),
                $mappingBag->getParamFormat('mapping_file') => $isOverwritable
                    ? $config['mapping'][$entityName]['mapping_file']
                    : $mappingBag->getEntityMappingFilePath(),
                $mappingBag->getParamFormat('manager') => $isOverwritable
                    ? $config['mapping'][$entityName]['manager']
                    : $mappingBag->getManagerName(),
                $mappingBag->getParamFormat('enabled') => $isOverwritable
                    ? $config['mapping'][$entityName]['enabled']
                    : $mappingBag->getEntityIsEnabled(),
            ]);
        }

        $container
            ->getParameterBag()
            ->add($mappedParameters);
    }
455795
public function load(array $config, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $config);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('container.yml');
        $loader->load('own.yml');
        $loader->load('system.yml');
        $loader->load('party.yml');
        $loader->load('store.yml');
        $loader->load('credential.yml');
        $loader->load('service.yml');
        $loader->load('provider.yml');
        $loader->load('profile.yml');

        $this->configureOwn($container, $config);
        $this->configureSystem($container, $config);
        $this->configureParty($container, $config);
        $this->configureStore($container, $config);
        $this->configureCredential($container, $config);
        $this->configureService($container, $config);
    }
465405
public function load(array $config, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/services'));
        $loader->load('montserrat.xml');

        if (isset($config['working_dir'])) {
            $container->setParameter('behat.montserrat.working_dir', $config['working_dir']);
        }

        if (isset($config['prepend_paths'])) {
            $parameterBag = $container->getParameterBag();
            $paths = array();
            foreach ($config['prepend_paths'] as $p) {
                $paths[] = $parameterBag->resolveValue($p); 
            }
            $container->setParameter('behat.montserrat.prepend_path', implode(PATH_SEPARATOR, $paths));
        }
    }
644054
public function load(array $config, ContainerBuilder $container)
    {
        if (!isset($config['framework_path'])) {
            throw new \InvalidArgumentException('Specify `framework_path` parameter for silverstripe_extension');
        }

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

        $behatBasePath = $container->getParameter('behat.paths.base');
        $config['framework_path'] = realpath(sprintf('%s%s%s',
            rtrim($behatBasePath, DIRECTORY_SEPARATOR),
            DIRECTORY_SEPARATOR,
            ltrim($config['framework_path'], DIRECTORY_SEPARATOR)
        ));
        if (!file_exists($config['framework_path']) || !is_dir($config['framework_path'])) {
            throw new \InvalidArgumentException('Path specified as `framework_path` either doesn\'t exist or is not a directory');
        }

        $container->setParameter('behat.silverstripe_extension.framework_path', $config['framework_path']);
        $container->setParameter('behat.silverstripe_extension.admin_url', $config['admin_url']);
        $container->setParameter('behat.silverstripe_extension.login_url', $config['login_url']);
        $container->setParameter('behat.silverstripe_extension.screenshot_path', $config['screenshot_path']);
        $container->setParameter('behat.silverstripe_extension.ajax_timeout', $config['ajax_timeout']);
        if (isset($config['ajax_steps'])) {
            $container->setParameter('behat.silverstripe_extension.ajax_steps', $config['ajax_steps']);
        }
        if (isset($config['region_map'])) {
             $container->setParameter('behat.silverstripe_extension.region_map', $config['region_map']);
        }
    }
694106
private function loadExecutorComponent(array $config, ContainerBuilder $container, LoaderInterface $loader)
    {
        $loader->load('executor/' . $config['type'] . '.xml');
        $container->setAlias('task.executor', 'task.executor.' . $config['type']);

        if (!array_key_exists($config['type'], $config)) {
            return;
        }

        foreach ($config[$config['type']] as $key => $value) {
            $container->setParameter('task.executor.' . $key, $value);
        }

        if (!file_exists($container->getParameter('task.executor.console_path'))) {
            throw new InvalidConfigurationException(
                'Console file does not exists! Given in "task.executor.seperate.console".'
            );
        }
    }
47759
public function load(array $config, ContainerBuilder $container): void
    {
        $config = $this->processConfiguration($this->getConfiguration([], $container), $config);
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        if ($config['assets']['enabled']) {
            $loader->load('services/integrations/assets.xml');
        }

        if ($config['templating']['enabled']) {
            $loader->load('services/integrations/templating.xml');
        }

        if ($config['translations']['enabled']) {
            $loader->load('services/integrations/translations.xml');
        }

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

        $container->setAlias('sylius.context.theme', $config['context']);
        $container->setAlias(ThemeContextInterface::class, 'sylius.context.theme');
    }
882895
protected function addJqueryTagsInputInAssetic(ContainerBuilder $container, array $config)
    {
        if ($config['js'] !== false && $config['css'] !== false) {
            $container->prependExtensionConfig('assetic', array(
                'assets' => array(
                    'jquerytagsinput_js' => $config['js'],
                    'jquerytagsinput_css' => $config['css'],
                ),
            ));
        } elseif ($config['js'] === false && $config['css'] !== false) {
            throw new InvalidConfigurationException('You have enabled jQuery Tags Input supports but js parameter is missing.');
        } elseif ($config['js'] !== false && $config['css'] === false) {
            throw new InvalidConfigurationException('You have enabled jQuery Tags Input supports but css parameter is missing.');
        }
    }
1017017
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $requestFilter = new RequestFilter($config);

        $container->add($config->getServiceName(), $requestFilter);
    }
1354522
private function defineConnectionConfigParameter(ContainerBuilder $container, $config)
    {
        $definition = new Definition('Rentgen\Database\Connection\ConnectionConfig');
        $definition->setArguments(array($config['environments']));
        $container->setDefinition('connection_config', $definition);
    }
1301456
public function configureSettings($config, ContainerBuilder $container)
    {
        $container->setParameter('rz_search.slugify_service',                                   $config['slugify_service']);
        $container->setParameter('rz_search.settings.search.pagination.per_page',               $config['search']['pagination']['per_page']);
        $container->setParameter('rz_search.settings.search.variables.search_query',            $config['search']['variables']['search_query']);
        $container->setParameter('rz_search.settings.search.variables.templates',               $config['search']['templates']);
        $container->setParameter('rz_search.settings.search.variables.default_identifier',      $config['search']['variables']['default_identifier']);

        $container->setParameter('rz_search.settings.search.controller.search',                 $config['search']['controller']['search']);
        $container->setParameter('rz_search.settings.search.controller.ajax',                   $config['search']['controller']['ajax']);
    }
96356
public function configureCdnAdapter(ContainerBuilder $container, array $config)
    {
        // add the default configuration for the server cdn
        if ($container->hasDefinition('sonata.media.cdn.server') && isset($config['cdn']['server'])) {
            $container->getDefinition('sonata.media.cdn.server')
                ->replaceArgument(0, $config['cdn']['server']['path'])
            ;
        } else {
            $container->removeDefinition('sonata.media.cdn.server');
        }

        if ($container->hasDefinition('sonata.media.cdn.panther') && isset($config['cdn']['panther'])) {
            $container->getDefinition('sonata.media.cdn.panther')
                ->replaceArgument(0, $config['cdn']['panther']['path'])
                ->replaceArgument(1, $config['cdn']['panther']['username'])
                ->replaceArgument(2, $config['cdn']['panther']['password'])
                ->replaceArgument(3, $config['cdn']['panther']['site_id'])
            ;
        } else {
            $container->removeDefinition('sonata.media.cdn.panther');
        }

        if ($container->hasDefinition('sonata.media.cdn.cloudfront') && isset($config['cdn']['cloudfront'])) {
            $container->getDefinition('sonata.media.cdn.cloudfront')
                ->replaceArgument(0, $config['cdn']['cloudfront']['path'])
                ->replaceArgument(1, $config['cdn']['cloudfront']['key'])
                ->replaceArgument(2, $config['cdn']['cloudfront']['secret'])
                ->replaceArgument(3, $config['cdn']['cloudfront']['distribution_id'])
            ;
        } else {
            $container->removeDefinition('sonata.media.cdn.cloudfront');
        }

        if ($container->hasDefinition('sonata.media.cdn.fallback') && isset($config['cdn']['fallback'])) {
            $container->getDefinition('sonata.media.cdn.fallback')
                ->replaceArgument(0, new Reference($config['cdn']['fallback']['master']))
                ->replaceArgument(1, new Reference($config['cdn']['fallback']['fallback']))
            ;
        } else {
            $container->removeDefinition('sonata.media.cdn.fallback');
        }
    }
1348517
protected function addPrismJSInAssetic(ContainerBuilder $container, array $config)
    {
        if ($config['js'] !== false && $config['css'] !== false) {
            $container->prependExtensionConfig('assetic', array(
                'assets' => array(
                    'prismjs_js' => $config['js'],
                    'prismjs_css' => $config['css'],
                ),
            ));
        } elseif ($config['js'] === false && $config['css'] !== false) {
            throw new InvalidConfigurationException('You have enabled PrismJS supports but js parameter is missing.');
        } elseif ($config['js'] !== false && $config['css'] === false) {
            throw new InvalidConfigurationException('You have enabled PrismJS supports but css parameter is missing.');
        }
    }
900134
public function load(ContainerBuilder $container, array $config): void
    {
        $this->crossContainerProcessor->addContainerAccessor('behat', new ContainerBasedContainerAccessor($container));
    }
1001091
public function load(array $config, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->setParameter('twig.template_dir', $config['template_dir']);

        $container->register('twig.asset_extension', 'Nice\Twig\AssetExtension')
            ->addArgument(new Reference('service_container'))
            ->addTag('twig.extension');

        $container->register('twig.router_extension', 'Nice\Twig\RouterExtension')
            ->addArgument(new Reference('service_container'))
            ->addTag('twig.extension');

        $container->register('twig.loader', 'Twig_Loader_Filesystem')
            ->addArgument(array('%twig.template_dir%'));

        $container->register('twig', 'Twig_Environment')
            ->addArgument(new Reference('twig.loader'));

        $container->register('templating.engine.twig', 'Nice\Templating\TwigEngine')
            ->addArgument(new Reference('twig'))
            ->addArgument(new Reference('templating.template_name_parser'))
            ->addTag('templating.engine');
    }