Symfony\Component\HttpKernel\Kernel::boot PHP Method

boot() public method

This method boots the bundles, which MUST set the DI container.
public boot ( )
    public function boot()
    {
        if (true === $this->booted) {
            throw new \LogicException('The kernel is already booted.');
        }

        if (!$this->isDebug()) {
            require_once __DIR__.'/bootstrap.php';
        }

        $this->bundles = $this->registerBundles();
        $this->bundleDirs = $this->registerBundleDirs();
        $this->container = $this->initializeContainer();

        // load core classes
        ClassCollectionLoader::load(
            $this->container->getParameter('kernel.compiled_classes'),
            $this->container->getParameter('kernel.cache_dir'),
            'classes',
            $this->container->getParameter('kernel.debug'),
            true
        );

        foreach ($this->bundles as $bundle) {
            $bundle->setContainer($this->container);
            $bundle->boot();
        }

        $this->booted = true;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @return null
  */
 public function setUp()
 {
     $this->kernel = new \AppKernel('test', true);
     $this->kernel->boot();
     $this->container = $this->kernel->getContainer();
     parent::setUp();
 }
All Usage Examples Of Symfony\Component\HttpKernel\Kernel::boot