class DrupalBoot8 extends DrupalBoot implements AutoloaderAwareInterface (View source)

Traits

LoggerAwareTrait
ContainerAwareTrait

Properties

protected $uri from BaseBoot
protected $loader from AutoloaderAwareTrait
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.

setUri(string $uri)

Inject the uri for the specific site to be bootstrapped

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
inflect($object)

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()

Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.

legacyValidRootCheck($root)

No description

bootstrapDrupalRoot()

Bootstrap Drush with a valid Drupal Directory.

bootstrapDrupalSiteValidate()

VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.

bootstrapDoDrupalSite()

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

bootstrapDrupalSite()

Initialize a site on the Drupal root.

bootstrapDrupalConfiguration(AnnotationData $annotationData = null)

Initialize and load the Drupal configuration files.

bootstrapDrupalDatabaseValidate()

Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase

TRUE
bootstrapDrupalDatabaseHasTable($required_tables)

Test to see if the Drupal database has a specified table or tables.

bootstrapDrupalDatabase()

Boostrap the Drupal database.

bootstrapDrupalFull()

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

addLogger()

No description

bootstrapDrupalCore($drupal_root)

No description

commandIgnored($command, $ignored_modules)

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

setUri(string $uri)

Inject the uri for the specific site to be bootstrapped

Parameters

string $uri Site to bootstrap

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

protected inflect($object)

Parameters

$object

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()

Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.

In this function, we will check if a valid Drupal directory is available. We also determine the value that will be stored in the DRUSH_DRUPAL_ROOT context and DRUPAL_ROOT constant if it is considered a valid option.

protected legacyValidRootCheck($root)

Parameters

$root

bootstrapDrupalRoot()

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.

bootstrapDrupalSiteValidate()

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.

bootstrapDoDrupalSite()

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

bootstrapDrupalSite()

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.

bootstrapDrupalConfiguration(AnnotationData $annotationData = null)

Initialize and load the Drupal configuration files.

Parameters

AnnotationData $annotationData

bootstrapDrupalDatabaseValidate()

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.

TRUE bootstrapDrupalDatabaseHasTable($required_tables)

Test to see if the Drupal database has a specified table or tables.

This is a bootstrap helper function designed to be called from the bootstrapDrupalDatabaseValidate() methods of derived DrupalBoot classes. If a database exists, but is empty, then the Drupal database bootstrap will fail. To prevent this situation, we test for some table that is needed in an ordinary bootstrap, and return FALSE from the validate function if it does not exist, so that we do not attempt to start the database bootstrap.

Note that we must manually do our own prefix testing here, because the existing wrappers we have for handling prefixes depend on bootstrapping to the "database" phase, and therefore are not available to validate this same phase.

Parameters

$required_tables Array of table names, or string with one table name

Return Value

TRUE if all required tables exist in the database.

bootstrapDrupalDatabase()

Boostrap the Drupal database.

bootstrapDrupalFull()

Attempt to load the full Drupal system.

setAutoloader($loader)

Parameters

$loader

autoloader()

hasAutoloader()

Request getRequest()

Return Value

Request

setRequest(Request $request)

Parameters

Request $request

DrupalKernelInterface getKernel()

Return Value

DrupalKernelInterface

addLogger()

bootstrapDrupalCore($drupal_root)

Parameters

$drupal_root

bootstrapDrupalConfigurationValidate()

commandIgnored($command, $ignored_modules)

Parameters

$command
$ignored_modules