db_is_active

Versions
6 – 7
db_is_active()

Determine 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

TRUE if there is at least one database connection established, FALSE otherwise.

Related topics

▾ 4 functions call db_is_active()

authorize_filetransfer_form_submit in includes/authorize.inc
Submit callback when a file transfer is being authorized.
list_themes in includes/theme.inc
Return a list of all currently available themes.
template_preprocess in includes/theme.inc
Adds a default set of helper variables for variable processors and templates. This comes in before any other preprocess function which makes it possible to be used in default theme implementations (non-overriden theme functions).
_drupal_maintenance_theme in includes/theme.maintenance.inc
Sets up the theming system for site installs, updates and when the site is in maintenance mode. It also applies when the database is unavailable.

Code

includes/database/database.inc, line 2076

<?php
function db_is_active() {
  return Database::isActiveConnection();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.