You are here

protected function Kernel::prepareContainer in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Kernel.php \Symfony\Component\HttpKernel\Kernel::prepareContainer()

Prepares the ContainerBuilder before it is compiled.

Parameters

ContainerBuilder $container A ContainerBuilder instance:

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 611

Class

Kernel
The Kernel is the heart of the Symfony system.

Namespace

Symfony\Component\HttpKernel

Code

protected function prepareContainer(ContainerBuilder $container) {
  $extensions = array();
  foreach ($this->bundles as $bundle) {
    if ($extension = $bundle
      ->getContainerExtension()) {
      $container
        ->registerExtension($extension);
      $extensions[] = $extension
        ->getAlias();
    }
    if ($this->debug) {
      $container
        ->addObjectResource($bundle);
    }
  }
  foreach ($this->bundles as $bundle) {
    $bundle
      ->build($container);
  }

  // ensure these extensions are implicitly loaded
  $container
    ->getCompilerPassConfig()
    ->setMergePass(new MergeExtensionConfigurationPass($extensions));
}