function MysqlRequirements::runtime

Implements hook_runtime_requirements().

Attributes

#[Hook('runtime_requirements')]

File

core/modules/mysql/src/Hook/MysqlRequirements.php, line 23

Class

MysqlRequirements
Requirements for the MySQL module.

Namespace

Drupal\mysql\Hook

Code

public function runtime() : array {
  if (!Database::isActiveConnection()) {
    return [];
  }
  $connection = Database::getConnection();
  // Only show requirements when MySQL is the default database connection.
  if (!($connection->driver() === 'mysql' && $connection->getProvider() === 'mysql')) {
    return [];
  }
  return $this->getRuntimeRequirements($connection);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.