예제 #1
0
 private function __construct()
 {
     // Get list of files matching the defined format
     $files = $this->getFiles(Pfc_Config::profileOutputFormat(), Pfc_Config::profileDir() . '/');
     // Sort by mtime
     uasort($files, array($this, 'mtimeCmp'));
     $this->files = $files;
 }
예제 #2
0
파일: index.php 프로젝트: RobinMao/pfc
function pfc_ajax_get_history_profiles($dataFile)
{
    $result = array();
    $matchs = array();
    preg_match(Pfc_Config::profileOutputFormat(), $dataFile, $matchs);
    $urlname = $matchs[3];
    $timestamp = $matchs[2];
    $realPath = Pfc_Config::profileDir() . '/' . $urlname;
    if (file_exists($realPath)) {
        $files = preg_grep(Pfc_Config::profileOutputFormat(), scandir($realPath));
        foreach ($files as $file) {
            $result[] = array('filename' => $file, 'mtime' => date("Y-m-d H:i:s", substr($file, 8, 10)));
        }
    }
    return json_encode($result);
}
예제 #3
0
파일: data_tsv.php 프로젝트: RobinMao/pfc
<?php

require './config.php';
require './library/FileHandler.php';
$filename = $_GET['file'];
if ($filename == '0') {
    $files = Pfc_FileHandler::getInstance()->getTraceList();
    $filename = $files[0]['filename'];
}
$format = Pfc_Config::profileOutputFormat();
$matchs = array();
preg_match($format, $filename, $matchs);
$urlname = $matchs[3];
$tsvFileName = $urlname . '.tsv';
$dataDir = Pfc_Config::tsvdir();
$realFile = $dataDir . $tsvFileName;
$data = file_get_contents($realFile);
echo $data;