function Database::getConnectionInfo

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
  2. 10 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getConnectionInfo()
  3. 11.x 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

12 calls to Database::getConnectionInfo()
BrowserTestBase::cleanupEnvironment in core/tests/Drupal/Tests/BrowserTestBase.php
Clean up the Simpletest environment.
Database::getConnectionInfoAsUrl in core/lib/Drupal/Core/Database/Database.php
Gets database connection info as a URL.
DbCommandBase::getDatabaseConnection in core/lib/Drupal/Core/Command/DbCommandBase.php
Parse input options decide on a database.
FunctionalTestSetupTrait::installParameters in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallCommand::isDrupalInstalled in core/lib/Drupal/Core/Command/InstallCommand.php
Returns whether there is already an existing Drupal installation.

... See full list

File

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

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.