兼容php5.2

pull/109/head
midoks 5 years ago
parent d988286eba
commit 9110b52b65
  1. 7
      plugins/xhprof/lib/xhprof_lib/utils/xhprof_runs.php

@ -55,7 +55,6 @@ interface iXHProfRuns {
public function save_run($xhprof_data, $type, $run_id = null);
}
/**
* XHProfRuns_Default is the default implementation of the
* iXHProfRuns interface for saving/fetching XHProf runs.
@ -145,11 +144,15 @@ class XHProfRuns_Default implements iXHProfRuns {
return $run_id;
}
function list_runs_callback($a, $b) {
return filemtime($b) - filemtime($a);
}
function list_runs() {
if (is_dir($this->dir)) {
echo "<hr/>Existing runs:\n<ul>\n";
$files = glob("{$this->dir}/*.{$this->suffix}");
usort($files, function($a, $b) {return filemtime($b) - filemtime($a);});
usort($files, 'list_runs_callback');
foreach ($files as $file) {
list($run, $source) = explode('.', basename($file));
echo '<li><a href="' . htmlentities($_SERVER['SCRIPT_NAME'])

Loading…
Cancel
Save