Пример #1
0
 public function getProfileDataRaw($file, $type = 'current')
 {
     $dir = '';
     if ($type == 'history') {
         $fileInfo = $this->parseFilename($file);
         $dir = $fileInfo['urlname'];
         if (strlen($dir)) {
             $dir .= '/';
         }
     }
     //echo '---------------------dir-'.$dir;
     $realFile = Pfc_Config::profileDir() . '/' . $dir . $file;
     if (!file_exists($realFile)) {
         error_log("Could not find file {$realFile}");
         return null;
     }
     $contents = file_get_contents($realFile);
     return unserialize($contents);
 }
Пример #2
0
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
 static function tsvdir()
 {
     return Pfc_Config::profileDir() . '/' . 'datatsv/';
 }