function Database::isActiveConnection
Same name in other branches
- 7.x includes/database/database.inc \Database::isActiveConnection()
- 9 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::isActiveConnection()
- 10 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::isActiveConnection()
- 11.x core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\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.
1 call to Database::isActiveConnection()
- DatabaseLegacyTest::testDbClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DatabaseLegacyTest.php - Tests the db_close() function.
File
-
core/
lib/ Drupal/ Core/ Database/ Database.php, line 184
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]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.