class MergeExtensionConfigurationPass in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php \Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass
- 8 vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php \Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php \Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass
Merges extension configs into the container builder.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass implements CompilerPassInterface
Expanded class hierarchy of MergeExtensionConfigurationPass
2 files declare their use of MergeExtensionConfigurationPass
- MergeExtensionConfigurationPass.php in vendor/
symfony/ http-kernel/ DependencyInjection/ MergeExtensionConfigurationPass.php - MergeExtensionConfigurationPassTest.php in vendor/
symfony/ dependency-injection/ Tests/ Compiler/ MergeExtensionConfigurationPassTest.php
File
- vendor/
symfony/ dependency-injection/ Compiler/ MergeExtensionConfigurationPass.php, line 22
Namespace
Symfony\Component\DependencyInjection\CompilerView source
class MergeExtensionConfigurationPass implements CompilerPassInterface {
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container) {
$parameters = $container
->getParameterBag()
->all();
$definitions = $container
->getDefinitions();
$aliases = $container
->getAliases();
$exprLangProviders = $container
->getExpressionLanguageProviders();
foreach ($container
->getExtensions() as $extension) {
if ($extension instanceof PrependExtensionInterface) {
$extension
->prepend($container);
}
}
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
->setResourceTracking($container
->isTrackingResources());
$tmpContainer
->addObjectResource($extension);
foreach ($exprLangProviders as $provider) {
$tmpContainer
->addExpressionLanguageProvider($provider);
}
$extension
->load($config, $tmpContainer);
$container
->merge($tmpContainer);
$container
->getParameterBag()
->add($parameters);
}
$container
->addDefinitions($definitions);
$container
->addAliases($aliases);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MergeExtensionConfigurationPass:: |
public | function |
You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface:: |
1 |