You are here

public function XHProfRunsFile::scanXHProfDir in XHProf 6

Same name in this branch
  1. 6 XHProfRunsFile.inc \XHProfRunsFile::scanXHProfDir()
  2. 6 XHProfLib/XHProfRuns.php \XHProfRunsFile::scanXHProfDir()
Same name and namespace in other branches
  1. 7 XHProfRunsFile.inc \XHProfRunsFile::scanXHProfDir()
  2. 7 XHProfLib/XHProfRuns.php \XHProfRunsFile::scanXHProfDir()
2 calls to XHProfRunsFile::scanXHProfDir()
XHProfRunsFile::getRuns in ./XHProfRunsFile.inc
XHProfRunsFile::getRuns in XHProfLib/XHProfRuns.php

File

XHProfLib/XHProfRuns.php, line 46

Class

XHProfRunsFile

Code

public function scanXHProfDir($dir, $namespace = NULL) {
  if (is_dir($dir)) {
    $runs = array();
    foreach (glob("{$this->dir}/*.{$this->suffix}") as $file) {
      list($run, $source) = explode('.', basename($file));
      $runs[] = array(
        'run_id' => $run,
        'namespace' => $source,
        'basename' => htmlentities(basename($file)),
        'date' => date("Y-m-d H:i:s", filemtime($file)),
      );
    }
  }
  return array_reverse($runs);
}