function Database::getConnectionInfo
Same name in other branches
- 9 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
- 8.9.x core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
- 10 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
- 11.x core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
Gets information on the specified database connection.
Parameters
$connection: The connection key for which we want information.
13 calls to Database::getConnectionInfo()
- ConnectionUnitTest::addConnection in modules/
simpletest/ tests/ database_test.test - Adds a new database connection info to Database.
- ConnectionUnitTest::setUp in modules/
simpletest/ tests/ database_test.test - Sets up unit test environment.
- DatabaseConnectionTestCase::testConnectionOptions in modules/
simpletest/ tests/ database_test.test - Tests the connection options of the active database.
- DatabaseConnectionTestCase::testConnectionRouting in modules/
simpletest/ tests/ database_test.test - Test that connections return appropriate connection objects.
- DatabaseConnectionTestCase::testConnectionRoutingOverride in modules/
simpletest/ tests/ database_test.test - Test that connections return appropriate connection objects.
File
-
includes/
database/ database.inc, line 1699
Class
- Database
- Primary front-controller for the database system.
Code
public static final function getConnectionInfo($key = 'default') {
if (empty(self::$databaseInfo)) {
self::parseConnectionInfo();
}
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.