class BootstrapManager implements LoggerAwareInterface, ConfigAwareInterface (View source)

Traits

LoggerAwareTrait
ConfigAwareTrait

Properties

protected DrushDrupalFinder $drupalFinder
protected Boot[] $bootstrapCandidates
protected Boot $bootstrap
protected int $phase

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

int
getPhase()

No description

void
setPhase(int $phase)

No description

void
add($candidateList)

Add a bootstrap object to the list of candidates.

drupalFinder()

No description

void
setDrupalFinder(DrushDrupalFinder $drupalFinder)

No description

string
getRoot()

Return the framework root selected by the user.

string
getComposerRoot()

Return the composer root for the selected Drupal site.

getUri()

Return the framework uri selected by the user.

selectUri($cwd)

This method is called by the Application iff the user did not explicitly provide a URI.

void
setUri($uri)

No description

bootstrap()

Crete the bootstrap object if necessary, then return it.

void
injectBootstrap(Boot $bootstrap)

For use in testing

bootstrapObjectForRoot($path)

Look up the best bootstrap class for the given location from the set of available candidates.

array
bootstrapPhases(bool $function_names = false)

Returns an array that determines what bootstrap phases are necessary to bootstrap the CMS.

bool
doBootstrap(int $phase, int|bool $phase_max = false, AnnotationData $annotationData = null)

Bootstrap Drush to the desired phase.

bool
hasBootstrap()

hasBootstrap determines whether the manager has a bootstrap object yet.

bool
hasBootstrapped(int $phase)

Determine whether a given bootstrap phase has been completed.

bool
bootstrapValidate(int $phase)

Validate whether a bootstrap phase can be reached.

bool
bootstrapToPhase(string $bootstrapPhase, AnnotationData $annotationData = null)

Bootstrap to the specified phase.

maxPhaseLimit($bootstrap_str)

No description

bool
bootstrapToPhaseIndex(int $max_phase_index, AnnotationData $annotationData = null)

Bootstrap to the specified phase.

int
bootstrapMax(int $max_phase_index = false, AnnotationData $annotationData = null)

Bootstrap to the highest level possible, without triggering any errors.

LoggerInterface|null
logger()

Allow those with a reference to the BootstrapManager to use its logger

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

int getPhase()

No description

Return Value

int

protected void setPhase(int $phase)

No description

Parameters

int $phase

Return Value

void

void add($candidateList)

Add a bootstrap object to the list of candidates.

Parameters

$candidateList

Return Value

void

DrushDrupalFinder drupalFinder()

No description

Return Value

DrushDrupalFinder

void setDrupalFinder(DrushDrupalFinder $drupalFinder)

No description

Parameters

DrushDrupalFinder $drupalFinder

Return Value

void

string getRoot()

Return the framework root selected by the user.

Return Value

string

string getComposerRoot()

Return the composer root for the selected Drupal site.

Return Value

string

getUri()

Return the framework uri selected by the user.

selectUri($cwd)

This method is called by the Application iff the user did not explicitly provide a URI.

Parameters

$cwd

void setUri($uri)

No description

Parameters

$uri

Return Value

void

Boot bootstrap()

Crete the bootstrap object if necessary, then return it.

Return Value

Boot

void injectBootstrap(Boot $bootstrap)

For use in testing

Parameters

Boot $bootstrap

Return Value

void

Boot bootstrapObjectForRoot($path)

Look up the best bootstrap class for the given location from the set of available candidates.

Parameters

$path

Return Value

Boot

array bootstrapPhases(bool $function_names = false)

Returns an array that determines what bootstrap phases are necessary to bootstrap the CMS.

Parameters

bool $function_names

(optional) If TRUE, return an array of method names index by their corresponding phase values. Otherwise return an array of phase values.

Return Value

array

See also

Boot::bootstrapPhases

bool doBootstrap(int $phase, int|bool $phase_max = false, AnnotationData $annotationData = null)

Bootstrap Drush to the desired phase.

This function will sequentially bootstrap each lower phase up to the phase that has been requested.

Parameters

int $phase

The bootstrap phase to bootstrap to.

int|bool $phase_max

(optional) The maximum level to boot to. This does not have a use in this function itself but can be useful for other code called from within this function, to know if e.g. a caller is in the process of booting to the specified level. If specified, it should never be lower than $phase.

AnnotationData $annotationData

Optional annotation data from the command.

TRUE if the specified bootstrap phase has completed.

Return Value

bool

See also

Boot::bootstrapPhases

bool hasBootstrap()

hasBootstrap determines whether the manager has a bootstrap object yet.

Return Value

bool

bool hasBootstrapped(int $phase)

Determine whether a given bootstrap phase has been completed.

Parameters

int $phase

The bootstrap phase to test

TRUE if the specified bootstrap phase has completed.

Return Value

bool

bool bootstrapValidate(int $phase)

Validate whether a bootstrap phase can be reached.

This function will validate the settings that will be used during the actual bootstrap process, and allow commands to progressively bootstrap to the highest level that can be reached.

This function will only run the validation function once, and store the result from that execution in a local static. This avoids validating phases multiple times.

Parameters

int $phase

The bootstrap phase to validate to.

TRUE if bootstrap is possible, FALSE if the validation failed.

Return Value

bool

See also

Boot::bootstrapPhases

bool bootstrapToPhase(string $bootstrapPhase, AnnotationData $annotationData = null)

Bootstrap to the specified phase.

Parameters

string $bootstrapPhase

Name of phase to bootstrap to. Will be converted to appropriate index. Optional annotation data from the command.

TRUE if the specified bootstrap phase has completed.

AnnotationData $annotationData

Return Value

bool

Exceptions

Exception

protected maxPhaseLimit($bootstrap_str)

No description

Parameters

$bootstrap_str

bool bootstrapToPhaseIndex(int $max_phase_index, AnnotationData $annotationData = null)

Bootstrap to the specified phase.

Parameters

int $max_phase_index

Only attempt bootstrap to the specified level. Optional annotation data from the command. TRUE if the specified bootstrap phase has completed.

AnnotationData $annotationData

Return Value

bool

int bootstrapMax(int $max_phase_index = false, AnnotationData $annotationData = null)

Bootstrap to the highest level possible, without triggering any errors.

Parameters

int $max_phase_index

(optional) Only attempt bootstrap to the specified level.

AnnotationData $annotationData

Optional annotation data from the command.

The maximum phase to which we bootstrapped.

Return Value

int

LoggerInterface|null logger()

Allow those with a reference to the BootstrapManager to use its logger

Return Value

LoggerInterface|null