function BootableCommandTrait::boot

Boots up a Drupal environment.

Return value

\Drupal\Core\DrupalKernelInterface The Drupal kernel.

Throws

\Exception Exception thrown if kernel does not boot.

1 call to BootableCommandTrait::boot()
RecipeInfoCommand::execute in core/lib/Drupal/Core/Recipe/RecipeInfoCommand.php

File

core/lib/Drupal/Core/Command/BootableCommandTrait.php, line 33

Class

BootableCommandTrait
Contains helper methods for console commands that boot up Drupal.

Namespace

Drupal\Core\Command

Code

protected function boot() : DrupalKernelInterface {
    $kernel = new DrupalKernel('prod', $this->classLoader);
    $kernel::bootEnvironment();
    $kernel->setSitePath($this->getSitePath());
    Settings::initialize($kernel->getAppRoot(), $kernel->getSitePath(), $this->classLoader);
    $kernel->boot();
    $kernel->preHandle(Request::createFromGlobals());
    return $kernel;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.