You are here

function _xhprof_get_object in XHProf 7

Same name and namespace in other branches
  1. 6 xhprof.module \_xhprof_get_object()

File

./xhprof.module, line 224

Code

function _xhprof_get_object() {
  static $xhprof_object = NULL;
  if (empty($xhprof_object)) {
    $class = variable_get('xhprof_default_class', 'XHProfRunsFile');
    if (class_exists($class)) {
      $xhprof_object = new $class();
    }
    else {
      watchdog('xhprof', 'Unable to load default class %class!', array(
        '%class' => $class,
      ), WATCHDOG_CRITICAL);
    }
  }
  return $xhprof_object;
}