Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BootableCommandTrait.php

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
Executes the current command.

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal