function Database::getConnectionInfo

Same name in other branches
  1. 7.x includes/database/database.inc \Database::getConnectionInfo()
  2. 9 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
  3. 8.9.x core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
  4. 10 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()

Gets information on the specified database connection.

Parameters

string $key: (optional) The connection key for which to return information.

Return value

array|null

55 calls to Database::getConnectionInfo()
BrowserTestBase::cleanupEnvironment in core/tests/Drupal/Tests/BrowserTestBase.php
Clean up the test environment.
ConnectionTest::testConnectionOptions in core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
Tests the connection options of the active database.
ConnectionTest::testConnectionRouting in core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
Tests that connections return appropriate connection objects.
ConnectionTest::testConnectionRoutingOverride in core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
Tests that connections return appropriate connection objects.
ConnectionTest::testPerTablePrefixOption in core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
Tests per-table prefix connection option.

... See full list

File

core/lib/Drupal/Core/Database/Database.php, line 307

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

public static final function getConnectionInfo($key = 'default') {
    if (!empty(self::$databaseInfo[$key])) {
        return self::$databaseInfo[$key];
    }
}

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