class DrupalBoot8 extends DrupalBoot implements AutoloaderAwareInterface (View source)

Traits

LoggerAwareTrait

Properties

protected $uri from BaseBoot
protected $phase from BaseBoot
protected $loader from AutoloaderAwareTrait
protected LoggerInterface $drupalLoggerAdapter
protected DrupalKernelInterface $kernel
protected Request $request

Methods

__construct()

No description

from BaseBoot
findUri($root, $cwd)

Select the best URI for the provided cwd. Only called if the user did not explicitly specify a URI.

getUri()

No description

from BaseBoot
setUri(string $uri)

Inject the uri for the specific site to be bootstrapped

from BaseBoot
int
getPhase()

No description

from BaseBoot
setPhase(int $phase)

No description

from BaseBoot
TRUE
validRoot($path)

This function determines if the specified path points to the root directory of a CMS that can be bootstrapped by the specific subclass that implements it.

string|NULL
getVersion($drupal_root)

Given a site root directory, determine the exact version of the software.

commandDefaults()

No description

from BaseBoot
reportCommandError($command)

Called by Drush if a command is not found, or if the command was found, but did not meet requirements.

from BaseBoot
array
bootstrapPhases()

Bootstrap phases used with Drupal:

bootstrapPhaseMap()

Return an array mapping from bootstrap phase shorthand strings (e.g. "full") to the corresponding bootstrap phase index constant (e.g. DRUSH_BOOTSTRAP_DRUPAL_FULL).

lookUpPhaseIndex($phase)

Convert from a phase shorthand or constant to a phase index.

from BaseBoot
bootstrapDrush()

No description

from BaseBoot
hasRegisteredSymfonyCommand($application, $name)

No description

from BaseBoot
void
terminate()

This method is called during the shutdown of drush.

scanUpForUri($root, $scan)

No description

confPath($require_settings = true, $reset = false)

No description

bootstrapDrupalRootValidate(BootstrapManager $manager)

Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.

bootstrapDrupalRoot(BootstrapManager $manager)

Bootstrap Drush with a valid Drupal Directory.

bootstrapDrupalSiteValidate(BootstrapManager $manager)

VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.

bootstrapDrupalSite(BootstrapManager $manager)

Initialize a site on the Drupal root.

bootstrapDrupalConfiguration(BootstrapManager $manager, AnnotationData $annotationData = null)

Initialize and load the Drupal configuration files.

bootstrapDrupalDatabaseValidate(BootstrapManager $manager)

Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase

bootstrapDrupalDatabase(BootstrapManager $manager)

Bootstrap the Drupal database.

bootstrapDrupalFull(BootstrapManager $manager)

Attempt to load the full Drupal system.

setAutoloader($loader)

No description

autoloader()

No description

hasAutoloader()

No description

Request
getRequest()

No description

setRequest(Request $request)

No description

DrupalKernelInterface
getKernel()

No description

setLogger(LoggerInterface $logger)

Sometimes (e.g. in the integration tests), the DrupalBoot object will be cached, and re-injected into a fresh set of preflight / bootstrap objects. When this happens, the new Drush logger will be injected into the boot object. If this happens after we have created the Drupal logger adapter (i.e., after bootstrapping Drupal), then we also need to update the logger reference in that adapter.

addLogger()

No description

bootstrapDrupalCore(BootstrapManager $manager, $drupal_root)

No description

bootstrapDoDrupalSite(BootstrapManager $manager)

Called by bootstrapDrupalSite to do the main work of the drush drupal site bootstrap.

addDrupalModuleDrushCommands($manager)

No description

Details

__construct()

findUri($root, $cwd)

Select the best URI for the provided cwd. Only called if the user did not explicitly specify a URI.

Parameters

$root
$cwd

getUri()

setUri(string $uri)

Inject the uri for the specific site to be bootstrapped

Parameters

string $uri Site to bootstrap

int getPhase()

Return Value

int

setPhase(int $phase)

Parameters

int $phase

TRUE validRoot($path)

This function determines if the specified path points to the root directory of a CMS that can be bootstrapped by the specific subclass that implements it.

These functions should be written such that one and only one class will return TRUE for any given $path.

Parameters

$path to a directory to test

Return Value

TRUE if $path is a valid root directory

string|NULL getVersion($drupal_root)

Given a site root directory, determine the exact version of the software.

Parameters

$drupal_root

Return Value

string|NULL The version string for the current version of the software, e.g. 8.1.3

commandDefaults()

reportCommandError($command)

Called by Drush if a command is not found, or if the command was found, but did not meet requirements.

The implementation in BaseBoot should be sufficient for most cases, so this method typically will not need to be overridden.

Parameters

$command

array bootstrapPhases()

Bootstrap phases used with Drupal:

DRUSH_BOOTSTRAP_DRUSH = Only Drush. DRUSH_BOOTSTRAP_DRUPAL_ROOT = Find a valid Drupal root. DRUSH_BOOTSTRAP_DRUPAL_SITE = Find a valid Drupal site. DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION = Load the site's settings. DRUSH_BOOTSTRAP_DRUPAL_DATABASE = Initialize the database. DRUSH_BOOTSTRAP_DRUPAL_FULL = Initialize Drupal fully.

The value is the name of the method of the Boot class to execute when bootstrapping. Prior to bootstrapping, a "validate" method is called, if defined. The validate method name is the bootstrap method name with "_validate" appended.

Return Value

array of PHASE index => method name.

bootstrapPhaseMap()

Return an array mapping from bootstrap phase shorthand strings (e.g. "full") to the corresponding bootstrap phase index constant (e.g. DRUSH_BOOTSTRAP_DRUPAL_FULL).

lookUpPhaseIndex($phase)

Convert from a phase shorthand or constant to a phase index.

Parameters

$phase

bootstrapDrush()

protected hasRegisteredSymfonyCommand($application, $name)

Parameters

$application
$name

void terminate()

This method is called during the shutdown of drush.

Return Value

void

protected scanUpForUri($root, $scan)

Parameters

$root
$scan

confPath($require_settings = true, $reset = false)

Parameters

$require_settings
$reset

bootstrapDrupalRootValidate(BootstrapManager $manager)

Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.

In this function, we will check if a valid Drupal directory is available.

Parameters

BootstrapManager $manager

bootstrapDrupalRoot(BootstrapManager $manager)

Bootstrap Drush with a valid Drupal Directory.

In this function, the pwd will be moved to the root of the Drupal installation.

We also now load the drush.yml for this specific Drupal site. We can now include files from the Drupal tree, and figure out more context about the codebase, such as the version of Drupal.

Parameters

BootstrapManager $manager

bootstrapDrupalSiteValidate(BootstrapManager $manager)

VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.

In this function we determine the URL used for the command, and check for a valid settings.php file.

Parameters

BootstrapManager $manager

bootstrapDrupalSite(BootstrapManager $manager)

Initialize a site on the Drupal root.

We now set various contexts that we determined and confirmed to be valid. Additionally we load an optional drush.yml file in the site directory.

Parameters

BootstrapManager $manager

bootstrapDrupalConfiguration(BootstrapManager $manager, AnnotationData $annotationData = null)

Initialize and load the Drupal configuration files.

Parameters

BootstrapManager $manager
AnnotationData $annotationData

bootstrapDrupalDatabaseValidate(BootstrapManager $manager)

Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase

Attempt to make a working database connection using the database credentials that were loaded during the previous phase.

Parameters

BootstrapManager $manager

bootstrapDrupalDatabase(BootstrapManager $manager)

Bootstrap the Drupal database.

Parameters

BootstrapManager $manager

bootstrapDrupalFull(BootstrapManager $manager)

Attempt to load the full Drupal system.

Parameters

BootstrapManager $manager

setAutoloader($loader)

Parameters

$loader

autoloader()

hasAutoloader()

Request getRequest()

Return Value

Request

setRequest(Request $request)

Parameters

Request $request

DrupalKernelInterface getKernel()

Return Value

DrupalKernelInterface

setLogger(LoggerInterface $logger)

Sometimes (e.g. in the integration tests), the DrupalBoot object will be cached, and re-injected into a fresh set of preflight / bootstrap objects. When this happens, the new Drush logger will be injected into the boot object. If this happens after we have created the Drupal logger adapter (i.e., after bootstrapping Drupal), then we also need to update the logger reference in that adapter.

Parameters

LoggerInterface $logger

addLogger()

bootstrapDrupalCore(BootstrapManager $manager, $drupal_root)

Parameters

BootstrapManager $manager
$drupal_root

bootstrapDoDrupalSite(BootstrapManager $manager)

Called by bootstrapDrupalSite to do the main work of the drush drupal site bootstrap.

Parameters

BootstrapManager $manager

bootstrapDrupalConfigurationValidate(BootstrapManager $manager)

Parameters

BootstrapManager $manager

addDrupalModuleDrushCommands($manager)

Parameters

$manager