class PreflightVerify (View source)

Helper methods to verify preflight state.

Methods

void
verify(Environment $environment)

Throw an exception if the environment is not right for running Drush.

void
confirmPhpVersion(string|null $minimumPhpVersion)

Fail fast if the php version does not meet the minimum requirements.

void
confirmUsingCLI(Environment $environment)

Fail if not being run from the command line.

void
checkPhpIni()

Evaluate the environment before command bootstrapping begins. If the php environment is too restrictive, then notify the user that a setting change is needed and abort.

bool
invalidIniValue(mixed $ini_value, string|array $disallowed_value)

Determine whether an ini value is valid based on the criteria.

string
loadedPhpIniMessage()

Returns a localizable message about php.ini that varies depending on whether the php_ini_loaded_file() is available or not.

Details

void verify(Environment $environment)

Throw an exception if the environment is not right for running Drush.

Parameters

Environment $environment

Return Value

void

void confirmPhpVersion(string|null $minimumPhpVersion)

Fail fast if the php version does not meet the minimum requirements.

Parameters

string|null $minimumPhpVersion

The minimum allowable php version

Return Value

void

protected void confirmUsingCLI(Environment $environment)

Fail if not being run from the command line.

Parameters

Environment $environment

Return Value

void

protected void checkPhpIni()

Evaluate the environment before command bootstrapping begins. If the php environment is too restrictive, then notify the user that a setting change is needed and abort.

Return Value

void

protected bool invalidIniValue(mixed $ini_value, string|array $disallowed_value)

Determine whether an ini value is valid based on the criteria.

Parameters

mixed $ini_value

The value of the ini setting being tested.

string|array $disallowed_value

The value that the ini setting cannot be, or a list of disallowed values that cannot appear in the setting.

Return Value

bool

protected string loadedPhpIniMessage()

Returns a localizable message about php.ini that varies depending on whether the php_ini_loaded_file() is available or not.

Return Value

string