本文整理汇总了PHP中CCache::cacheExists方法的典型用法代码示例。如果您正苦于以下问题:PHP CCache::cacheExists方法的具体用法?PHP CCache::cacheExists怎么用?PHP CCache::cacheExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCache
的用法示例。
在下文中一共展示了CCache::cacheExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
protected function render($view, $controller = "site", $arrResult = array(), $template = TEMPLATE)
{
$cache = new CCache(604800);
$flagCache = false;
if (!$cache->cacheExists(CApp::getHashCurPage()) && false) {
$flagCache = true;
$cache->startCache();
}
include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/header.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/views/" . strtolower($controller) . "/" . $view . ".php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/footer.php";
if ($flagCache) {
$cache->writeCache(filterGetValue(CApp::getHashCurPage()));
}
}
示例2: render
protected function render($view, $controller = "site", $arrResult = [], $template = null)
{
if ($template == null) {
$template = CApp::settings('APPLICATION')->templates['default'];
}
$cache = new CCache(604800);
$flagCache = false;
if (!$cache->cacheExists(CApp::getHashCurPage()) && CApp::settings("APPLICATION")->settings['cache_on']) {
$flagCache = true;
$cache->startCache();
}
include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/header.php";
include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/views/" . strtolower($controller) . "/" . $view . ".php";
include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/footer.php";
if ($flagCache) {
$cache->writeCache(filterGetValue(CApp::getHashCurPage()));
}
}