/** * 内部函数缓存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; }
function host() { return router::host(); }