Remap parameters.

@param ContainerBuilder $container
@param string           $prefix
@param array            $config
335251
private function remapParameters(ContainerBuilder $container, $prefix, array $config)
    {
        foreach ($config as $key => $value) {
            $container->setParameter(sprintf('%s.%s', $prefix, $key), $value);
        }
    }
307659
public function registerParameters(ContainerBuilder $container, array $config): void
    {
        $container->setParameter('sonata.dashboard.block.class', $config['class']['block']);
        $container->setParameter('sonata.dashboard.dashboard.class', $config['class']['dashboard']);

        $container->setParameter('sonata.dashboard.admin.block.entity', $config['class']['block']);
        $container->setParameter('sonata.dashboard.admin.dashboard.entity', $config['class']['dashboard']);

        $container->setParameter(
            'sonata.dashboard.admin.dashboard.templates.compose',
            $config['templates']['compose']
        );
        $container->setParameter(
            'sonata.dashboard.admin.dashboard.templates.compose_container_show',
            $config['templates']['compose_container_show']
        );
        $container->setParameter(
            'sonata.dashboard.admin.dashboard.templates.render',
            $config['templates']['render']
        );

        $container->setParameter('sonata.dashboard.default_container', $config['default_container']);
    }
550234
protected function loadConfiguration(ContainerBuilder $container, array $config)
    {
        $container->setParameter('jb_fileuploader.endpoints', $config);
        $container->setParameter('jb_fileuploader.crop_route', $config['crop_route']);
    }
91636
private function configureStorage(array $config, ContainerBuilder $container)
    {
        $container->register('doctrine.key_value.storage', 'Doctrine\KeyValueStore\Storage\DoctrineCacheStorage')
            ->setPublic(false)
            ->addArgument(new Reference('cache.' . $config['cache_driver']));
    }
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');
    }
435761
public function bindParameters(ContainerBuilder $container, $name, $config) {
        if (is_array($config) && empty($config[0])) {
            foreach ($config as $key => $value) {
                $this->bindParameters($container, $name . '.' . $key, $value);
            }
        } else {
            $container->setParameter($name, $config);
        }
    }
790154
protected function processParameters(array $config, Container $container, $alias = "")
    {
        if (!isset($config["parameters"])) {
            return;
        }
        if (!$this->isAssocArray($config["parameters"])) {
            throw new ConfigException("The 'parameters' configuration must be an associative array");
        }
        foreach ($config["parameters"] as $key => $value) {
            $aliasedKey = $this->referenceResolver->aliasThisKey($key, $alias);
            if ($container->offsetExists($aliasedKey) && $alias != "") {
                continue;
            }

            if (!$this->referenceResolver->keyIsAliased($key)) {
                $key = $aliasedKey;
            }

            $resolver = $this->referenceResolver;
            $container[$key] = function () use ($value, $resolver, $container, $key, $alias) {
                try {
                    return $resolver->resolveParameter($value, $container, $alias);
                } catch (ReferenceException $e) {
                    throw new ReferenceException("Error with key '$key'. " . $e->getMessage());
                }
            };
            $this->parameterNames[] = $key;
        }
    }
1341132
public function prepend(ContainerBuilder $container)
    {
        $config = array('twig' => array(
            'template' => 'AdmingeneratorGeneratorBundle:KnpMenu:knp_menu_trans.html.twig'
        ));

        foreach ($container->getExtensions() as $name => $extension) {
            switch ($name) {
                case 'knp_menu':
                    $container->prependExtensionConfig($name, $config);
                    break;
            }
        }
    }
647456
public function configureTemplates(ContainerBuilder $container, array $config)
    {
        $templateManager = $container->getDefinition('sonata.page.template_manager');

        // add all templates to manager
        $definitions = [];
        foreach ($config['templates'] as $code => $info) {
            $definition = new Definition(Template::class, [
                $info['name'],
                $info['path'],
                $info['containers'],
            ]);

            $definition->setPublic(false);
            $definitions[$code] = $definition;
        }

        $templateManager->addMethodCall('setAll', [$definitions]);

        // set default template
        $templateManager->addMethodCall('setDefaultTemplateCode', [$config['default_template']]);
    }
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);
            }
        }
    }
646855
public function load (array $config, ContainerBuilder $container)
    {
        // parse configuration
        $parsedConfiguration = $this->processConfiguration(new Configuration(), $config);

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

        // build role collection
        $builder = new RoleCollectionBuilder();

        $roleCollectionDefinition = $container->getDefinition("becklyn.static_roles.role_collection");
        $roleCollectionDefinition->replaceArgument(0, $builder->prepareRoleCollection($parsedConfiguration["roles"]));
    }
310205
public function load(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../Resources/config')
        );

        // Base services override
        $loader->load('services.yml');
    }
96946
public function configureTwigBundle(ContainerBuilder $container, array $config)
    {
    	foreach(array_keys($container->getExtensions()) as $name) {
    		switch($name) {
    			case 'twig':
    				$container->prependExtensionConfig($name, array(
    					'form_themes' => array($config['form_theme'])
    				));
    				break;
    		}
    	}
    }
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');
        }
    }
703810
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->createConfiguration();
        $this->globalConfig = $this->processConfiguration($configuration, $configs);

        $container->setParameter($this->rootAlias.'.configuration', $this->globalConfig);

        parent::load($configs, $container);
    }
1278321
public function load(array $configs, ContainerBuilder $container)
    {
        $fileSrc = dirname($this->reflector->getFileName()) . $this->xmlFilePath;
        $loader  = new XmlFileLoader($container, new FileLocator($fileSrc));
        $loader->load($this->xmlFileName);
    }
441483
public function load(ContainerBuilder $container, array $config)
    {
        $container->setDefinition(self::API_CLIENT_ID, new Definition(ApiClient::class, [
            new Reference(SymfonyExtension::DRIVER_KERNEL_ID),
            $config['base_url']
        ]));

        $this->loadContextInitializer($container);
        $this->loadApiClientListener($container);

        $container->setParameter('symfony_api_extension.parameters', $config);
    }