DrupalBoot8
class DrupalBoot8 extends DrupalBoot (View source)
Traits
Properties
protected string|bool | $uri | from BaseBoot | |
protected int | $phase | from BaseBoot | |
protected DrupalKernelInterface|null | $kernel | ||
protected Request | $request |
Methods
Select the best URI for the provided cwd. Only called if the user did not explicitly specify a URI.
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.
Given a site root directory, determine the exact version of the software.
Called by Drush if a command is not found, or if the command was found, but did not meet requirements.
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).
This method is called during the shutdown of drush.
Beware, this function populates Database::Connection info.
Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.
VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.
Initialize and load the Drupal configuration files.
Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase
No description
No description
No description
Called by bootstrapDrupalSite to do the main work of the Drush drupal site bootstrap.
Details
__construct(ServiceManager $serviceManager, $autoloader)
No description
findUri($root, $cwd)
Select the best URI for the provided cwd. Only called if the user did not explicitly specify a URI.
string
getUri()
No description
setUri(string $uri)
Inject the uri for the specific site to be bootstrapped
int
getPhase()
No description
void
setPhase(int $phase)
No description
bool
validRoot(string|null $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.
string|null
getVersion(string $root)
Given a site root directory, determine the exact version of the software.
commandDefaults()
No description
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.
array
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.
bootstrapDrush()
No description
protected bool
hasRegisteredSymfonyCommand($application, $name)
No description
void
terminate()
This method is called during the shutdown of drush.
protected
scanUpForUri($root, $scan)
No description
string|null
confPath(bool $require_settings = true, bool $reset = false)
Beware, this function populates Database::Connection info.
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.
bool
bootstrapDrupalRootValidate(BootstrapManager $manager)
Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.
In this function, we will check if a valid Drupal directory is available.
void
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.
string
bootstrapDrupalCore(BootstrapManager $manager, string $drupal_root)
No description
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.
bootstrapDrupalConfiguration(BootstrapManager $manager, AnnotationData|null $annotationData = null)
Initialize and load the Drupal configuration files.
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.
void
bootstrapDrupalDatabase(BootstrapManager $manager)
Bootstrap the Drupal database.
void
bootstrapDrupalFull(BootstrapManager $manager)
Attempt to load the full Drupal system.
Request
getRequest()
No description
void
setRequest(Request $request)
No description
DrupalKernelInterface
getKernel()
No description
void
bootstrapDoDrupalSite(BootstrapManager $manager)
Called by bootstrapDrupalSite to do the main work of the Drush drupal site bootstrap.
bool
bootstrapDrupalConfigurationValidate(BootstrapManager $manager)
No description
void
addDrupalModuleDrushCommands(BootstrapManager $manager)
No description
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.