function Database::isActiveConnection
Determines if there is an active connection.
Note that this method will return FALSE if no connection has been established yet, even if one could be.
Return value
bool TRUE if there is at least one database connection established, FALSE otherwise.
4 calls to Database::isActiveConnection()
- MysqliHooks::runtimeRequirements in core/
modules/ mysqli/ src/ Hook/ MysqliHooks.php - Implements hook_runtime_requirements().
- MysqlRequirements::runtime in core/
modules/ mysql/ src/ Hook/ MysqlRequirements.php - Implements hook_runtime_requirements().
- PgsqlRequirements::getRequirements in core/
modules/ pgsql/ src/ Install/ Requirements/ PgsqlRequirements.php - Tasks::isConnectionActive in core/
lib/ Drupal/ Core/ Database/ Install/ Tasks.php - Determines if there is an active connection.
File
-
core/
lib/ Drupal/ Core/ Database/ Database.php, line 166
Class
- Database
- Primary front-controller for the database system.
Namespace
Drupal\Core\DatabaseCode
final public static function isActiveConnection() {
return !empty(self::$activeKey) && !empty(self::$connections) && !empty(self::$connections[self::$activeKey]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.