function Connection::getServerVersion

Same name in this branch
  1. 10 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::getServerVersion()
Same name in other branches
  1. 9 core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::getServerVersion()
  2. 9 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::getServerVersion()
  3. 11.x core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::getServerVersion()
  4. 11.x core/modules/system/tests/modules/driver_test/src/Driver/Database/DriverTestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DriverTestMysqlDeprecatedVersion\Connection::getServerVersion()

Gets the server version.

Return value

string The PDO server version.

2 calls to Connection::getServerVersion()
Connection::getMariaDbVersionMatch in core/modules/mysql/src/Driver/Database/mysql/Connection.php
Gets the MariaDB portion of the server version.
Connection::version in core/modules/mysql/src/Driver/Database/mysql/Connection.php
1 method overrides Connection::getServerVersion()
Connection::getServerVersion in core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php
Gets the server version.

File

core/modules/mysql/src/Driver/Database/mysql/Connection.php, line 302

Class

Connection
MySQL implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\mysql\Driver\Database\mysql

Code

protected function getServerVersion() : string {
    if (!$this->serverVersion) {
        $this->serverVersion = $this->query('SELECT VERSION()')
            ->fetchField();
    }
    return $this->serverVersion;
}

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