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.
3 calls to Database::isActiveConnection()
- mysql_requirements in core/
modules/ mysql/ mysql.install - Implements hook_requirements().
- pgsql_requirements in core/
modules/ pgsql/ pgsql.install - Implements hook_requirements().
- 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 163
Class
- Database
- Primary front-controller for the database system.
Namespace
Drupal\Core\DatabaseCode
public static final function isActiveConnection() {
return !empty(self::$activeKey) && !empty(self::$connections) && !empty(self::$connections[self::$activeKey]);
}