You are here

protected function CorrectDbServerVersion::getMariaDbVersionMatch in Upgrade Status 8.3

Gets the MariaDB portion of the server version.

Return value

string The MariaDB portion of the server version if present, or NULL if not.

2 calls to CorrectDbServerVersion::getMariaDbVersionMatch()
CorrectDbServerVersion::getCorrectedDbServerVersion in src/Util/CorrectDbServerVersion.php
Returns corrected version of database.
CorrectDbServerVersion::isMariaDb in src/Util/CorrectDbServerVersion.php
Determines whether the MySQL distribution is MariaDB or not.

File

src/Util/CorrectDbServerVersion.php, line 74

Class

CorrectDbServerVersion

Namespace

Drupal\upgrade_status\Util

Code

protected function getMariaDbVersionMatch() : ?string {

  // MariaDB may prefix its version string with '5.5.5-', which should be
  // ignored.
  // @see https://github.com/MariaDB/server/blob/f6633bf058802ad7da8196d01fd19d75c53f7274/include/mysql_com.h#L42.
  $regex = '/^(?:5\\.5\\.5-)?(\\d+\\.\\d+\\.\\d+.*-mariadb.*)/i';
  preg_match($regex, $this
    ->getDatabaseServerVersion(), $matches);
  return empty($matches[1]) ? NULL : $matches[1];
}