コード例 #1
0
 private static function _getFileInfo($base, $action, $format = 'html')
 {
     // go see what templates are available
     $fileNamePatterns = array($action . '.' . $format, $action);
     $fileTypes = array('phtml' => 'Phtml', 'xhtml' => 'Xhtml');
     $fileName = null;
     foreach ($fileNamePatterns as $fileNamePattern) {
         foreach ($fileTypes as $fileType => $parserType) {
             $filePattern = $fileNamePattern . '.' . $fileType;
             if ($fileMatch = Ajde_FS_Find::findFile($base . TEMPLATE_DIR, $filePattern)) {
                 return array('filename' => $fileMatch, 'parser' => $parserType);
             }
         }
     }
     return false;
 }
コード例 #2
0
 public function getCacheStatus()
 {
     $hash = $this->getHash();
     $fileTimePattern = $hash['fileName'] . '.' . $hash['fileTime'] . '.' . $this->getType();
     if ($fileName = Ajde_FS_Find::findFile($this->getBase(), $fileTimePattern)) {
         return array('status' => self::CACHE_STATUS_EXIST, 'fileName' => $fileName);
     }
     $fileNamePattern = $hash['fileName'] . '.*.' . $this->getType();
     if ($fileName = Ajde_FS_Find::findFile($this->getBase(), $fileNamePattern)) {
         return array('status' => self::CACHE_STATUS_UPDATE, 'fileName' => $fileName);
     }
     return array('status' => self::CACHE_STATUS_NOT_EXIST, 'fileName' => '');
 }