Database::ignoreTarget

public static Database::ignoreTarget($key, $target) Instructs the system to temporarily ignore a given key/target. At times we need to temporarily disable replica queries. To do so, call this method with the database key and the target to disable. That database key will then always fall back to 'default' for that key, even if it's defined. Parameters string $key: The database connection key. string $target: The target of the specified key to ignore. File core/lib/Drupal/Core/Database/Database.

Database::getLog

final public static Database::getLog($logging_key, $key = 'default') Retrieves the queries logged on for given logging key. This method also ends logging for the specified key. To get the query log to date without ending the logger request the logging object by starting it again (which does nothing to an open log key) and call methods on it as desired. Parameters string $logging_key: The logging key to log. string $key: The database connection key for which we want to log. Return value array

Database::getConnectionInfoAsUrl

public static Database::getConnectionInfoAsUrl($key = 'default') Gets database connection info as a URL. Parameters string $key: (Optional) The database connection key. Return value string The connection info as a URL. File core/lib/Drupal/Core/Database/Database.php, line 499 Class Database Primary front-controller for the database system. Namespace Drupal\Core\Database Code public static function getConnectionInfoAsUrl($key = 'default') { $db_info = static::getConnectionInfo($key)

Database::getConnectionInfo

final public static Database::getConnectionInfo($key = 'default') Gets information on the specified database connection. Parameters string $key: (optional) The connection key for which to return information. Return value array|null File core/lib/Drupal/Core/Database/Database.php, line 265 Class Database Primary front-controller for the database system. Namespace Drupal\Core\Database Code final public static function getConnectionInfo($key = 'default') { if (!empty(self::$databaseIn

Database::getConnection

final public static Database::getConnection($target = 'default', $key = NULL) Gets the connection object for the specified database key and target. Parameters string $target: The database target name. string $key: The database connection key. Defaults to NULL which means the active key. Return value \Drupal\Core\Database\Connection The corresponding connection object. File core/lib/Drupal/Core/Database/Database.php, line 150 Class Database Primary front-controller for the database system

Database::getAllConnectionInfo

final public static Database::getAllConnectionInfo() Gets connection information for all available databases. Return value array File core/lib/Drupal/Core/Database/Database.php, line 276 Class Database Primary front-controller for the database system. Namespace Drupal\Core\Database Code final public static function getAllConnectionInfo() { return self::$databaseInfo; }

Database::convertDbUrlToConnectionInfo

public static Database::convertDbUrlToConnectionInfo($url, $root) Converts a URL to a database connection info array. Parameters string $url: The URL. string $root: The root directory of the Drupal installation. Return value array The database connection info. Throws \InvalidArgumentException Exception thrown when the provided URL does not meet the minimum requirements. File core/lib/Drupal/Core/Database/Database.php, line 457 Class Database Primary front-controller for the database sys

Database::closeConnection

public static Database::closeConnection($target = NULL, $key = NULL) Closes a connection to the server specified by the given key and target. Parameters string $target: The database target name. Defaults to NULL meaning that all target connections will be closed. string $key: The database connection key. Defaults to NULL which means the active key. File core/lib/Drupal/Core/Database/Database.php, line 399 Class Database Primary front-controller for the database system. Namespace Drupal

Database::addConnectionInfo

final public static Database::addConnectionInfo($key, $target, array $info) Adds database connection information for a given key/target. This method allows to add new connections at runtime. Under normal circumstances the preferred way to specify database credentials is via settings.php. However, this method allows them to be added at arbitrary times, such as during unit tests, when connecting to admin-defined third party databases, etc. If the given key/target pair already exists, this method

Database::$logs

An array of active query log objects. Every connection has one and only one logger object for all targets and logging keys. array( '$db_key' => DatabaseLog object. ); Type: array File core/lib/Drupal/Core/Database/Database.php, line 78 Class Database Primary front-controller for the database system. Namespace Drupal\Core\Database Code static protected $logs = array();