You are here

public function XHProfRunsFile::get_run in XHProf 6

Same name and namespace in other branches
  1. 7 XHProfRunsFile.inc \XHProfRunsFile::get_run()

File

./XHProfRunsFile.inc, line 57
Definition of XHProfRunsFile.

Class

XHProfRunsFile
XHProfRuns_Default is the default implementation of the iXHProfRuns interface for saving/fetching XHProf runs.

Code

public function get_run($run_id, $type, &$run_desc) {
  $file_name = $this
    ->file_name($run_id, $type);
  if (!file_exists($file_name)) {
    watchdog("xhprof", "Could not find file %file_name", array(
      '%file_name' => $file_name,
    ));
    $run_desc = "Invalid Run Id = {$run_id}";
    return NULL;
  }
  $contents = file_get_contents($file_name);
  $run_desc = "XHProf Run (Namespace={$type})";
  return unserialize($contents);
}