コード例 #1
0
ファイル: EcHtmlCache.class.php プロジェクト: noikiy/shop-3
 /**
  * 读取静态缓存文件
  * @param string $cachePath
  * @param number $expire
  * @return number|boolean
  */
 public static function read($cachePath = "", $expire = 1800)
 {
     self::$cacheFile = self::getCacheFile($cachePath);
     //静态缓存文件存在,且没有过期,则直接读取
     if (file_exists(self::$cacheFile) && time() < filemtime(self::$cacheFile) + $expire) {
         return readfile(self::$cacheFile);
     } else {
         ob_start();
         return false;
     }
 }
コード例 #2
0
 private function _writeHtmlCache()
 {
     if ($this->appConfig['HTML_CACHE_ON']) {
         EcHtmlCache::write();
     }
 }