Skip to content
Browse files

list existing runs sorted by filemtime desc

  • Loading branch information...
1 parent 8e90cba commit a17eba611422632ba792daf0cdb35e99854b6087 Salimane Adjao Moustapha committed Jul 27, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 xhprof_lib/utils/xhprof_runs.php
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);'));
billf added a note Feb 15, 2012

if someone had a setup where they created filenames with some intentional order, this change would break that.

that said, i have a hard time believing anyone would not want these to be sorted in order of date descending.

salimane added a note Feb 15, 2012

yep me too i can't believe somebody would not want that date descending order :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ foreach ($files as $file) {
list($run,$source) = explode('.', basename($file));
echo '<li><a href="' . htmlentities($_SERVER['SCRIPT_NAME'])
. '?run=' . htmlentities($run) . '&source='

0 comments on commit a17eba6

Please sign in to comment.
Something went wrong with that request. Please try again.