function get_global_database_handler

7.x get_global_database_handler()
6.x get_global_database_handler()
4.x get_global_database_handler()
5.x get_global_database_handler()

This method will return a globally-set DatabaseHandler object, creating it if it does not already exist. This is for efficiency reasons, so every module or method does not need to keep creating databasehandler objects (and re-connecting to the database).

92 calls to get_global_database_handler()
admin_apply_draft_changes_form_submit in modules/admin/admin.module
Handles the actual moving of draft courses into production.
admin_copy_degree_form_submit in modules/admin/
admin_display_groups_popup_show_group_use in modules/admin/
Displays a popup showing where a particular group is being used in FlightPath.
admin_duplicate_year_form_submit in modules/admin/admin.module
This function should perform the actual copy of data!
admin_edit_course_form in modules/admin/
This form lets the user edit details about a course.

... See full list


includes/, line 16
This file contains mostly db shortcuts.


function get_global_database_handler() {

  $db = NULL;

  if (isset($GLOBALS ["fp_global_database_handler"])) {
    $db = $GLOBALS ["fp_global_database_handler"];

  if (!is_object($db) || !is_object($db->pdo)) {
    // Something isn't right, or it wasn't set correctly.  Create a new connection.
    $GLOBALS ["fp_global_database_handler"] = new DatabaseHandler();

  return $GLOBALS ["fp_global_database_handler"];