class Tasks extends Tasks (View source)

deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module.

Specifies installation tasks for MySQL and equivalent databases.

Constants

MYSQL_MINIMUM_VERSION

Minimum required MySQL version.

5.7.8 is the minimum version that supports the JSON datatype.

MARIADB_MINIMUM_VERSION

Minimum required MariaDB version.

10.3.7 is the first stable (GA) release in the 10.3 series.

MYSQLND_MINIMUM_VERSION

Minimum required MySQLnd version.

LIBMYSQLCLIENT_MINIMUM_VERSION

Minimum required libmysqlclient version.

Properties

protected string $pdoDriver

The PDO driver name for MySQL and equivalent databases.

from  Tasks
protected array $tasks

Structure that describes each task to run.

from  Tasks
protected array $results

Results from tasks.

from  Tasks

Methods

bool
hasPdoDriver()

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

from  Tasks
fail($message)

Asserts test as failed.

from  Tasks
pass($message)

Asserts test as a pass.

from  Tasks
bool
installable()

Checks whether Drupal is installable on the database.

from  Tasks
string
name()

Returns the human-readable name of the driver.

from  Tasks
string|null
minimumVersion()

Returns the minimum required version of the engine.

from  Tasks
string[]
runTasks()

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

from  Tasks
engineVersionRequirementsCheck()

Checks engine version requirements for the status report.

from  Tasks
bool
connect()

Checks if we can connect to the database.

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

Ensures the database can execute commands with the current user.

from  Tasks
checkEngineVersion()

Checks the engine version.

from  Tasks
array
getFormOptions(array $database)

Returns driver specific configuration options.

from  Tasks
validateDatabaseSettings(array $database)

Validates driver specific configuration settings.

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

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

from  Tasks
bool
isConnectionActive()

Determines if there is an active connection.

from  Tasks
getConnection()

Returns the database connection.

from  Tasks
__construct()

Constructs a \Drupal\mysql\Driver\Database\mysql\Install\Tasks object.

from  Tasks
ensureInnoDbAvailable()

Ensure that InnoDB is available.

from  Tasks

Details

protected bool hasPdoDriver()

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

Return Value

bool

TRUE if the PDO driver is supported, otherwise FALSE.

protected fail($message)

Asserts test as failed.

Parameters

$message

protected pass($message)

Asserts test as a pass.

Parameters

$message

bool installable()

Checks whether Drupal is installable on the database.

Return Value

bool

TRUE if Drupal can be installed on the database, otherwise FALSE.

string name()

Returns the human-readable name of the driver.

Return Value

string

The human-readable name of the driver.

string|null minimumVersion()

Returns the minimum required version of the engine.

Return Value

string|null

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

string[] runTasks()

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

Return Value

string[]

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

Checks if we can connect to the database.

Return Value

bool

TRUE if we can connect to the database, otherwise FALSE.

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

Ensures the database can execute commands with the current user.

Parameters

$query
$pass
$fail
$fatal

protected checkEngineVersion()

Checks the engine version.

array getFormOptions(array $database)

Returns driver specific configuration options.

Parameters

array $database

An array of driver specific configuration options.

Return Value

array

The options form array.

TranslatableMarkup[] validateDatabaseSettings(array $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

array $database

An array of driver specific configuration options.

Return Value

TranslatableMarkup[]

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

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

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

Parameters

string $string

The string literal to translate.

array $args

Placeholder arguments to use inside the translated string (if any).

array $options

Options for the translation.

Return Value

TranslatableMarkup

An object representing the translatable markup for the given string.

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.

__construct()

Constructs a \Drupal\mysql\Driver\Database\mysql\Install\Tasks object.

ensureInnoDbAvailable()

Ensure that InnoDB is available.