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); }
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); }
static function tsvdir() { return Pfc_Config::profileDir() . '/' . 'datatsv/'; }