Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from salimane/master

list existing runs sorted by filemtime desc
  • Loading branch information...
commit bc8ef04c50457d0e3e0426af5312694c323e18b8 2 parents 469fe5a + a17eba6
@billf billf authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 xhprof_lib/utils/xhprof_runs.php
View
4 xhprof_lib/utils/xhprof_runs.php
@@ -149,7 +149,9 @@ public function save_run($xhprof_data, $type, $run_id = null) {
function list_runs() {
if (is_dir($this->dir)) {
echo "<hr/>Existing runs:\n<ul>\n";
- foreach (glob("{$this->dir}/*.{$this->suffix}") as $file) {
+ $files = glob("{$this->dir}/*.{$this->suffix}");
+ usort($files, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
+ foreach ($files as $file) {
list($run,$source) = explode('.', basename($file));
echo '<li><a href="' . htmlentities($_SERVER['SCRIPT_NAME'])
. '?run=' . htmlentities($run) . '&source='
Please sign in to comment.
Something went wrong with that request. Please try again.