예제 #1
0
파일: view.php 프로젝트: samplecms/package
 /**
  * 内部函数缓存HTML
  */
 static function cacheHtml()
 {
     if (static::$cache === false) {
         return;
     }
     $uri = $_SERVER['REQUEST_URI'];
     $uri = str_replace("//", '/', $uri);
     $uri = str_replace(router::host(), '', $uri);
     if (!$uri || $uri == '/') {
         $uri = "index";
     }
     if (static::$cacheFileName) {
         $url = WEB . "/" . static::$htmlcache . "/" . static::$cacheFileName . ".html";
     } else {
         $url = WEB . "/" . static::$htmlcache . "/" . $uri . ".html";
     }
     $url = str_replace('//', '/', $url);
     $dir = file::dir($url);
     if (!is_dir($dir)) {
         mkdir($dir, 0777, true);
     }
     return $url;
 }
예제 #2
0
function host()
{
    return router::host();
}