本文整理汇总了PHP中HTMLFileCache::fileCacheTime方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLFileCache::fileCacheTime方法的具体用法?PHP HTMLFileCache::fileCacheTime怎么用?PHP HTMLFileCache::fileCacheTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLFileCache
的用法示例。
在下文中一共展示了HTMLFileCache::fileCacheTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AjaxDispatcher
require_once $IP . '/includes/AjaxDispatcher.php';
$dispatcher = new AjaxDispatcher();
$dispatcher->performAction();
$mediaWiki->restInPeace();
exit;
}
if ($wgUseFileCache && isset($wgTitle)) {
wfProfileIn('main-try-filecache');
// Raw pages should handle cache control on their own,
// even when using file cache. This reduces hits from clients.
if ($action != 'raw' && HTMLFileCache::useFileCache()) {
/* Try low-level file cache hit */
$cache = new HTMLFileCache($wgTitle, $action);
if ($cache->isFileCacheGood()) {
/* Check incoming headers to see if client has this cached */
if (!$wgOut->checkLastModified($cache->fileCacheTime())) {
$cache->loadFromFileCache();
}
# Do any stats increment/watchlist stuff
$wgArticle = MediaWiki::articleFromTitle($wgTitle);
$wgArticle->viewUpdates();
# Tell $wgOut that output is taken care of
wfProfileOut('main-try-filecache');
$mediaWiki->restInPeace();
exit;
}
}
wfProfileOut('main-try-filecache');
}
# Setting global variables in mediaWiki
$mediaWiki->setVal('action', $action);
示例2: main
private function main()
{
global $wgUseFileCache, $wgTitle, $wgUseAjax;
wfProfileIn(__METHOD__);
# Set title from request parameters
$wgTitle = $this->getTitle();
$action = $this->getAction();
$user = $this->context->getUser();
# Send Ajax requests to the Ajax dispatcher.
if ($wgUseAjax && $action == 'ajax') {
$dispatcher = new AjaxDispatcher();
$dispatcher->performAction();
wfProfileOut(__METHOD__);
return;
}
if ($wgUseFileCache && $wgTitle->getNamespace() != NS_SPECIAL) {
wfProfileIn('main-try-filecache');
// Raw pages should handle cache control on their own,
// even when using file cache. This reduces hits from clients.
if (HTMLFileCache::useFileCache()) {
/* Try low-level file cache hit */
$cache = new HTMLFileCache($wgTitle, $action);
if ($cache->isFileCacheGood()) {
/* Check incoming headers to see if client has this cached */
$timestamp = $cache->fileCacheTime();
if (!$this->context->getOutput()->checkLastModified($timestamp)) {
$cache->loadFromFileCache();
}
# Do any stats increment/watchlist stuff
$article = WikiPage::factory($wgTitle);
$article->doViewUpdates($user);
# Tell OutputPage that output is taken care of
$this->context->getOutput()->disable();
wfProfileOut('main-try-filecache');
wfProfileOut(__METHOD__);
return;
}
}
wfProfileOut('main-try-filecache');
}
$this->performRequest();
$this->finalCleanup();
wfProfileOut(__METHOD__);
}