function Kernel::prepareContainer
Prepares the ContainerBuilder before it is compiled.
1 call to Kernel::prepareContainer()
- Kernel::buildContainer in vendor/
symfony/ http-kernel/ Kernel.php - Builds the service container.
File
-
vendor/
symfony/ http-kernel/ Kernel.php, line 618
Class
- Kernel
- The Kernel is the heart of the Symfony system.
Namespace
Symfony\Component\HttpKernelCode
protected function prepareContainer(ContainerBuilder $container) : void {
$extensions = [];
foreach ($this->bundles as $bundle) {
if ($extension = $bundle->getContainerExtension()) {
$container->registerExtension($extension);
}
if ($this->debug) {
$container->addObjectResource($bundle);
}
}
foreach ($this->bundles as $bundle) {
$bundle->build($container);
}
$this->build($container);
foreach ($container->getExtensions() as $extension) {
$extensions[] = $extension->getAlias();
}
// ensure these extensions are implicitly loaded
$container->getCompilerPassConfig()
->setMergePass(new MergeExtensionConfigurationPass($extensions));
}