abstract class Tasks (View source)

Database installer structure.

Defines basic Drupal requirements for databases.

Properties

protected string $pdoDriver

The name of the PDO driver this database type requires.

protected array $tasks

Structure that describes each task to run.

protected array $results

Results from tasks.

Methods

hasPdoDriver()

Ensure the PDO driver is supported by the version of PHP in use.

fail($message)

Assert test as failed.

pass($message)

Assert test as a pass.

installable()

Check whether Drupal is installable on the database.

name()

Return the human-readable name of the driver.

A
minimumVersion()

Return the minimum required version of the engine.

array
runTasks()

Run database tasks and tests to see if Drupal can run on the database.

engineVersionRequirementsCheck()

Checks engine version requirements for the status report.

connect()

Check if we can connect to the database.

runTestQuery($query, $pass, $fail, $fatal = FALSE)

Run SQL tests to ensure the database can execute commands with the current user.

checkEngineVersion()

Check the engine version.

The
getFormOptions(array $database)

Return driver specific configuration options.

An
validateDatabaseSettings($database)

Validates driver specific configuration settings.

t($string, array $args = [], array $options = [])

Translates a string to the current language or to a given language.

bool
isConnectionActive()

Determines if there is an active connection.

getConnection()

Returns the database connection.

Details

protected hasPdoDriver()

Ensure the PDO driver is supported by the version of PHP in use.

protected fail($message)

Assert test as failed.

Parameters

$message

protected pass($message)

Assert test as a pass.

Parameters

$message

installable()

Check whether Drupal is installable on the database.

abstract name()

Return the human-readable name of the driver.

A minimumVersion()

Return the minimum required version of the engine.

Return Value

A

version string. If not NULL, it will be checked against the version reported by the Database engine using version_compare().

array runTasks()

Run database tasks and tests to see if Drupal can run on the database.

Return Value

array

A list of error messages.

final TranslatableMarkup[] engineVersionRequirementsCheck()

Checks engine version requirements for the status report.

This method is called during runtime and update requirements checks.

Return Value

TranslatableMarkup[]

A list of error messages.

protected connect()

Check if we can connect to the database.

protected runTestQuery($query, $pass, $fail, $fatal = FALSE)

Run SQL tests to ensure the database can execute commands with the current user.

Parameters

$query
$pass
$fail
$fatal

protected checkEngineVersion()

Check the engine version.

The getFormOptions(array $database)

Return driver specific configuration options.

Parameters

array $database

An array of driver specific configuration options.

Return Value

The

options form array.

An validateDatabaseSettings($database)

Validates driver specific configuration settings.

Checks to ensure correct basic database settings and that a proper connection to the database can be established.

Parameters

$database

An array of driver specific configuration options.

Return Value

An

array of driver configuration errors, keyed by form element name.

protected t($string, array $args = [], array $options = [])

Translates a string to the current language or to a given language.

Parameters

$string
array $args
array $options

See also

TranslatableMarkup::__construct

protected bool isConnectionActive()

Determines if there is an active connection.

Return Value

bool

TRUE if there is at least one database connection established, FALSE otherwise.

protected Connection getConnection()

Returns the database connection.

Return Value

Connection

The database connection.