You are here

function xhprof_scandir in XHProf 6

Same name and namespace in other branches
  1. 7 xhprof.module \xhprof_scandir()

File

./xhprof.module, line 380

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);
}