public function XHProfRunsFile::save_run in XHProf 6
Same name and namespace in other branches
- 7 XHProfRunsFile.inc \XHProfRunsFile::save_run()
File
- ./XHProfRunsFile.inc, line 71
- Definition of XHProfRunsFile.
Class
- XHProfRunsFile
- XHProfRuns_Default is the default implementation of the
iXHProfRuns interface for saving/fetching XHProf runs.
Code
public function save_run($xhprof_data, $type, $run_id = NULL) {
$xhprof_data = serialize($xhprof_data);
if ($run_id === NULL) {
$run_id = $this
->gen_run_id($type);
}
$file_name = $this
->file_name($run_id, $type);
$file = fopen($file_name, 'w');
if ($file) {
fwrite($file, $xhprof_data);
fclose($file);
}
else {
watchdog("xhprof", "Could not open %file_name.", array(
'%file_name' => $file_name,
));
}
return $run_id;
}