Loads parameters into container

@param array            $mergedConfig Custom configuration merged with defaults
@param ContainerBuilder $container    Container for the Dependency Injection (DI)
@return BaseExtension
508041
private function loadParameters(array $mergedConfig, ContainerBuilder $container): BaseExtension
    {
        /*
         * No configuration?
         * Nothing to do
         */
        if (empty($mergedConfig)) {
            return $this;
        }

        // Getting the keys or paths on which building names of parameters should stop
        $keysToStop = $this->getKeysToStopLoadingParametersOn();
        $globalKeysToStop = $this->getGlobalKeysToStopLoadingParametersOn();

        // Merging standard with global keys and paths
        $keysToStop = Arrays::makeArray($keysToStop);
        $globalKeysToStop = Arrays::makeArray($globalKeysToStop);
        $stopIfMatchedBy = array_merge($keysToStop, $globalKeysToStop);

        // Let's get the last elements' paths and load values into container
        $parameters = Arrays::getLastElementsPaths($mergedConfig, '.', '', $stopIfMatchedBy);

        /** @var ConfigurationInterface $configuration */
        $configuration = $this->getConfiguration($mergedConfig, $container);

        // Getting slug of bundle's name
        $bundleShortName = $configuration
            ->getConfigTreeBuilder()
            ->buildTree()
            ->getName()
        ;

        foreach ($parameters as $name => $value) {
            if (!\is_array($value)) {
                $value = Miscellaneous::trimSmart($value);
            }

            // Loading parameter into container, prefixed by slug of bundle's name
            $prefixedName = sprintf('%s.%s', $bundleShortName, $name);
            $container->setParameter($prefixedName, $value); // e.g. simple_bundle.foo.bar.something => 'my-value'
        }

        return $this;
    }
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
1129655
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $reflection = new \ReflectionClass(Configuration::class);
        $container->addResource(new FileResource($reflection->getFileName()));

        return new Configuration();
    }
501037
protected function configureAsseticBundle(ContainerBuilder $container, array $config)
    {
        foreach (array_keys($container->getExtensions()) as $name) {
            switch ($name) {
                case 'assetic':
                    $asseticConfig = new AsseticConfiguration;
                    $container->prependExtensionConfig(
                        $name,
                        array('assets' => $asseticConfig->build($config))
                    );
                    break;
            }
        }
    }
538951
protected function loadExceptionManager(ContainerBuilder $container, array $config)
    {
        $definition = new Definition(
            'M6Web\Bundle\ApiExceptionBundle\Manager\ExceptionManager',
            [
                $config['default'],
                $config['exceptions'],
            ]
        );
        $definition->setPublic(true);

        $container->setDefinition($this->getAlias().'.manager.exception', $definition);
    }
1068038
public function load(ContainerBuilder $container, array $config)
  {
    $template_dir = __DIR__."/views/";
    if (isset($config["templates"]["dir"]))
    {
      $template_dir = $config["templates"]["dir"];
    }
    
    $definition = new Definition('\Twig_Loader_Filesystem', array($template_dir));
    $container->setDefinition("behat.twig_output.twig.loader", $definition);
    
    $definition = new Definition('\Twig_Environment', array(new Reference("behat.twig_output.twig.loader")));
    $container->setDefinition("behat.twig_output.twig.templating", $definition);
    
    $definition = new Definition('chartinger\Behat\TwigReportExtension\EventListener', array(new Reference("behat.twig_output.twig.templating")));
    $definition->addTag(EventDispatcherExtension::SUBSCRIBER_TAG, array());
    $definition->addMethodCall("setTemplate",array($config["templates"]["file"]));
    $definition->addMethodCall("setOutputFile",array($config["output"]["file"]));
    $definition->addMethodCall("setOutputDirectory",array($config["output"]["dir"]));
    $container->setDefinition("behat.twig_output.listener.event", $definition);
  }
641069
protected function loadInternal(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../Resources/config')
        );

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

        $registry = new Definition(MessageQueueRegistry::class);
        $container->setDefinition('alchemy_queues.registry', $registry);

        $queueConfigurations = $config['queues'];

        if ($config['logger'] != '') {
            $registry->addMethodCall('setLogger', [new Reference($config['logger'])]);
        }

        foreach ($queueConfigurations as $name => $configuration) {
            $targetRegistry = $registry;

            if (isset($configuration['registry'])) {
                $targetRegistry = $container->getDefinition($configuration['registry']);
            }

            $targetRegistry->addMethodCall('bindConfiguration', [$name, $configuration]);
        }
    }
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;
    		}
    	}
    }
1157267
protected function loadConfiguration(array $config, ContainerBuilder $container)
    {
        // Load page nested routes
        $routeConfigurationChain = $container->findDefinition('lp_factory.route_configuration.chain');
        foreach ($config['routes'] as $alias => $routeConfiguration) {
            $routeConfigurationChain->addMethodCall('add', array($alias, $routeConfiguration));
        }

        $routeFactoryId = $config['service_ids']['factory'];
        $treeStrategyId = $config['service_ids']['strategy'];

        // Inject service route factory
        $routeProvider = $container->findDefinition('lp_factory.route_provider');
        $routeProvider->replaceArgument(0, new Reference($routeFactoryId));
        $routeProvider->replaceArgument(3, new Reference($treeStrategyId));

        // Add repository and strategy arguments
        $routeFactory = $container->findDefinition($routeFactoryId);
        $routeFactory->replaceArgument(0, new Reference($config['repository']));
        $routeFactory->replaceArgument(1, new Reference($treeStrategyId));
        $abstractStrategy = $container->findDefinition('lp_factory.route_strategy.abstract');
        $abstractStrategy->replaceArgument(0, new Reference($config['repository']));
    }
597870
protected function loadInternal(
        array $mergedConfig,
        ContainerBuilder $container
    )
    {
        /**
         * Setting defined parameters to services
         */
        $container->setParameter('twitter.api_key',
            $mergedConfig['twitter']['api_key']
        );

        $container->setParameter('twitter.api_secret',
            $mergedConfig['twitter']['api_secret']
        );

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

        $loader->load('services.yml');
    }
1010632
public function load(array $config, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $this->configureStorage($config, $container);
        $this->configureMetadataDriver($config, $container);
        $this->configureEntityManager($config, $container);
    }
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);
    }
1327221
protected function postLoad(array $config, ContainerBuilder $container)
    {
        parent::postLoad($config, $container);

        $locatorProviderId = $config['location']['provider_adapter'];
        $container->setAlias('elcodi.location_provider', $locatorProviderId);

        $locatorPopulatorAdapterId = $config['location']['populator_adapter'];
        $container->setAlias('elcodi.location_populator_adapter', $locatorPopulatorAdapterId);

        $locatorLoaderAdapterId = $config['location']['loader_adapter'];
        $container->setAlias('elcodi.location_loader_adapter', $locatorLoaderAdapterId);
    }
385532
public function configureSettings($config, ContainerBuilder $container)
    {
        $container->setParameter('bruery.doctrine_orm_admin.settings.manager.clas',             $config['settings']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.proxy_query.class',        $config['settings']['proxy_query']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.model_manager.class',      $config['settings']['model_manager']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings',                          $config['settings']['doctrine_cache']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.doctrine_cache.enabled',   $config['settings']['doctrine_cache']['enabled']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.doctrine_cache.ttl',       $config['settings']['doctrine_cache']['ttl']);

        if ($config['settings']['doctrine_cache']['enabled']) {
            $definition = $container->getDefinition('bruery.doctrine_orm_admin.settings.manager');
            $definition->addMethodCall('setConfig', array('doctrine_cache',  $config['settings']['doctrine_cache']));
        }
    }
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']);
        }
    }
190458
public function load(ContainerBuilder $container, array $config) {
        // Client initializer definition
        $clientInitializerDefinition = new Definition(
            ApiClientAwareInitializer::class,
            [
                $config['apiClient']
            ]
        );
        $clientInitializerDefinition->addTag(ContextExtension::INITIALIZER_TAG);

        // Definition for the array contains comparator
        $comparatorDefinition = new Definition(ArrayContainsComparator::class);

        // Comparator initializer definition
        $comparatorInitializerDefinition = new Definition(
            ArrayContainsComparatorAwareInitializer::class,
            [
                new Reference(self::COMPARATOR_SERVICE_ID)
            ]
        );
        $comparatorInitializerDefinition->addTag(ContextExtension::INITIALIZER_TAG);

        // Add all definitions to the container
        $container->setDefinition(self::APICLIENT_INITIALIZER_SERVICE_ID, $clientInitializerDefinition);
        $container->setDefinition(self::COMPARATOR_SERVICE_ID, $comparatorDefinition);
        $container->setDefinition(self::COMPARATOR_INITIALIZER_SERVICE_ID, $comparatorInitializerDefinition);
    }
986700
public function load(ContainerBuilder $container, array $config)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Resources'));
        $loader->load('services.xml');

        if (isset($config['fixtures'])) {
            $container->setParameter('behat.alice.fixtures.default', $config['fixtures']['default']);
            $container->setParameter('behat.alice.fixtures.key_paths', $config['fixtures']['key_paths']);
            $container->setParameter('behat.alice.fixtures.default_loading', $config['fixtures']['default_loading']);
        }

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

        $container->setParameter('behat.alice.faker.locale', $config['faker']['locale']);
        $container->setParameter('behat.alice.faker.providers', $config['faker']['providers']);

        $adapters = array();
        foreach ($config['adapters'] as $name => $adapter) {
            $adapters[$name] = $adapter['fixture_class'];

            if (isset($adapter['mapping'])) {
                $container->setParameter('behat.alice.elastica_mapping', $adapter['mapping']);
            }

            if (isset($adapter['index_service'])) {
                $container->setParameter('behat.alice.elastica_index', $adapter['index_service']);
            }
        }
        $container->setParameter('behat.alice.adapters', $adapters);
    }