You are here

function monolog_logging_bootstrap in Monolog 6

Same name and namespace in other branches
  1. 7 modules/monolog_logging/monolog_logging.module \monolog_logging_bootstrap()

Ensure that required subsystems and modules are loaded if watchdog messages are logged prior to a full Drupal bootstrap.

See also

_drupal_bootstrap_full()

http://drupal.org/node/1997462

1 call to monolog_logging_bootstrap()
monolog_logging_watchdog in modules/monolog_logging/monolog_logging.module
Implements hook_watchdog().

File

modules/monolog_logging/monolog_logging.module, line 108
Integrates Drupal's internal logging system with Monolog by routing watchdog messages to Monolog channels.

Code

function monolog_logging_bootstrap() {
  static $bootstrapped = FALSE;
  if (!$bootstrapped) {
    $bootstrapped = TRUE;

    // CTools requires the drupal_get_path() and list_themes() functions.
    require_once DRUPAL_ROOT . '/includes/common.inc';
    require_once DRUPAL_ROOT . '/includes/theme.inc';
    require_once DRUPAL_ROOT . '/includes/unicode.inc';

    // Monolog requires the file_prepare_directory() function.
    require_once DRUPAL_ROOT . '/includes/file.inc';

    // Load the required modules.
    drupal_load('module', 'system');
    drupal_load('module', 'ctools');
    drupal_load('module', 'composer_manager');
    drupal_load('module', 'monolog');

    // Detect string handling method.
    unicode_check();

    // Undo magic quotes.
    fix_gpc_magic();

    // file_get_stream_wrappers() is called during the normal application flow.
  }
}