function xhprof_scandir in XHProf 7
Same name and namespace in other branches
- 6 xhprof.module \xhprof_scandir()
 
File
- ./
xhprof.module, line 409  
Code
function xhprof_scandir($dir, $source) {
  if (is_dir($dir)) {
    $runs = array();
    foreach (glob("{$dir}/*.{$source}") as $file) {
      list($run, $source) = explode('.', basename($file));
      $runs[] = array(
        'run_id' => $run,
        'source' => $source,
        'basename' => htmlentities(basename($file)),
        'date' => date("Y-m-d H:i:s", filemtime($file)),
      );
    }
  }
  return array_reverse($runs);
}