function RecipeCommand::boot

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Recipe/RecipeCommand.php \Drupal\Core\Recipe\RecipeCommand::boot()

Boots up a Drupal environment.

Return value

\Drupal\Core\DrupalKernelInterface The Drupal kernel.

Throws

\Exception Exception thrown if kernel does not boot.

File

core/lib/Drupal/Core/Recipe/RecipeCommand.php, line 194

Class

RecipeCommand
Applies recipe.

Namespace

Drupal\Core\Recipe

Code

protected function boot() {
    $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.