You are here

function new_relic_rpm_boot in New Relic 7

Implements hook_boot().

This is used to set various New Relic settings by URL.

File

./new_relic_rpm.module, line 212
Drupal module implementing New Relic.

Code

function new_relic_rpm_boot() {
  $ignore_urls = variable_get('new_relic_rpm_ignore_urls', '');
  $bg_urls = variable_get('new_relic_rpm_bg_urls', '');
  $exclu_urls = variable_get('new_relic_rpm_exclusive_urls', '');
  $job_state = '';

  // Handles cases where this is getting called from the command line and q
  // isn't set.
  $path = isset($_GET['q']) ? $_GET['q'] : '';
  if (!empty($exclu_urls) && !new_relic_rpm_page_match($path, $exclu_urls)) {
    $job_state = 'ignore';
  }
  elseif (!empty($ignore_urls) && new_relic_rpm_page_match($path, $ignore_urls)) {
    $job_state = 'ignore';
  }
  if ($job_state !== 'ignore' && !empty($bg_urls) && new_relic_rpm_page_match($path, $bg_urls)) {
    $job_state = 'bg';
  }
  if ($job_state !== '') {
    new_relic_rpm_set_job_state($job_state);
  }
}