public function MergeExtensionConfigurationPass::process

Same name in this branch
  1. 9.x drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php \Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass::process()
  2. 9.x drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php \Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass::process()

You can modify the container here before it is dumped to PHP code.

@api

Parameters

ContainerBuilder $container:

Overrides CompilerPassInterface::process

1 call to MergeExtensionConfigurationPass::process()
MergeExtensionConfigurationPass::process in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php
You can modify the container here before it is dumped to PHP code.
1 method overrides MergeExtensionConfigurationPass::process()
MergeExtensionConfigurationPass::process in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php
You can modify the container here before it is dumped to PHP code.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php, line 26

Class

MergeExtensionConfigurationPass
Merges extension configs into the container builder

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) {
  $parameters = $container
    ->getParameterBag()
    ->all();
  $definitions = $container
    ->getDefinitions();
  $aliases = $container
    ->getAliases();
  foreach ($container
    ->getExtensions() as $name => $extension) {
    if (!($config = $container
      ->getExtensionConfig($name))) {

      // this extension was not called
      continue;
    }
    $config = $container
      ->getParameterBag()
      ->resolveValue($config);
    $tmpContainer = new ContainerBuilder($container
      ->getParameterBag());
    $tmpContainer
      ->addObjectResource($extension);
    $extension
      ->load($config, $tmpContainer);
    $container
      ->merge($tmpContainer);
  }
  $container
    ->addDefinitions($definitions);
  $container
    ->addAliases($aliases);
  $container
    ->getParameterBag()
    ->add($parameters);
}