public function getFile($id, $type) { $tmpfile = tempnam(TMP_DIR, 'ecaesystem'); array_push($this->_tmpfiles, $tmpfile); if ($id && ecae_file_fetch($id, $tmpfile)) { return $tmpfile; } else { return false; } }
public function get_run($run_id, $type, &$run_desc) { if (defined("ECAE_MODE") && constant("ECAE_MODE")) { $file_name = tempnam(TMP_DIR, constant("ECAE_SITE_NAME") . "-xhprof"); if (!ecae_file_fetch($run_id, $file_name)) { xhprof_error("Could not find file {$run_id} from ECAE S3"); $run_desc = "Invalid Run Id = {$run_id}"; return null; } } else { $file_name = $this->file_name($run_id, $type); if (!file_exists($file_name)) { xhprof_error("Could not find file {$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); }