function Connection::version

Same name in this branch
  1. 11.x core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::version()
  2. 11.x core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::version()
Same name and namespace in other branches
  1. 9 core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::version()
  2. 9 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::version()
  3. 9 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::version()
  4. 8.9.x core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::version()
  5. 8.9.x core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::version()
  6. 10 core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::version()
  7. 10 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Connection::version()
  8. 10 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::version()

Returns the version of the database server.

Assumes the client connection is \PDO. Non-PDO based drivers need to override this method.

Return value

string

1 method overrides Connection::version()
Connection::version in core/modules/mysql/src/Driver/Database/mysql/Connection.php
Returns the version of the database server.

File

core/lib/Drupal/Core/Database/Connection.php, line 1189

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function version() {
    return $this->connection
        ->getAttribute(\PDO::ATTR_SERVER_VERSION);
}

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