You are here

function new_relic_rpm_extension_installed in New Relic 7

Checks if the new_relic extension is installed.

Return value

bool TRUE if the extension is installed, FALSE if not.

4 calls to new_relic_rpm_extension_installed()
new_relic_rpm_cron in ./new_relic_rpm.module
Implements hook_cron().
new_relic_rpm_drush_init in ./new_relic_rpm.drush.inc
Implements hook_drush_init().
new_relic_rpm_preprocess_html in ./new_relic_rpm.module
Implements hook_preprocess_html().
new_relic_rpm_set_job_state in ./new_relic_rpm.module
Tells New Relic if a job should be ignored or counted as a background job.

File

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

Code

function new_relic_rpm_extension_installed() {
  static $newrelic_module;
  if (!isset($newrelic_module)) {
    $newrelic_module = function_exists('newrelic_background_job');
  }

  // If newrelic module isn't loaded into php, error and return.
  if (!$newrelic_module) {

    // Only throw error if we've booted far enough to watchdog.
    // i.e. drush updatedb.
    if (function_exists('module_implements') && !variable_get('new_relic_rpm_suppress_module_not_enabled_error_always', FALSE) && (PHP_SAPI !== 'cli' || !variable_get('new_relic_rpm_suppress_module_not_enabled_error_on_cli', FALSE))) {
      watchdog('New Relic', 'New Relic module not enabled.', array(), WATCHDOG_ERROR);
    }
    return FALSE;
  }
  return TRUE;
}