Skip to content

Commit

Permalink
Merge pull request phacility#2 from salimane/master
Browse files Browse the repository at this point in the history
list existing runs sorted by filemtime desc
  • Loading branch information
bill fumerola committed Feb 23, 2012
2 parents 469fe5a + a17eba6 commit bc8ef04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xhprof_lib/utils/xhprof_runs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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='
Expand Down

0 comments on commit bc8ef04

Please sign in to comment.