本文整理汇总了PHP中false::isCacheable方法的典型用法代码示例。如果您正苦于以下问题:PHP false::isCacheable方法的具体用法?PHP false::isCacheable怎么用?PHP false::isCacheable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类false
的用法示例。
在下文中一共展示了false::isCacheable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doWork
/**
* @return bool
*/
function doWork()
{
global $wgParser, $wgUseFileCache;
$isCurrent = $this->revid === $this->page->getLatest();
if ($this->text !== null) {
$text = $this->text;
} elseif ($isCurrent) {
$text = $this->page->getRawText();
} else {
$rev = Revision::newFromTitle($this->page->getTitle(), $this->revid);
if ($rev === null) {
return false;
}
$text = $rev->getText();
}
$time = -microtime(true);
$this->parserOutput = $wgParser->parse($text, $this->page->getTitle(), $this->parserOptions, true, true, $this->revid);
$time += microtime(true);
# Timing hack
if ($time > 3) {
wfDebugLog('slow-parse', sprintf("%-5.2f %s", $time, $this->page->getTitle()->getPrefixedDBkey()));
}
if ($this->cacheable && $this->parserOutput->isCacheable()) {
ParserCache::singleton()->save($this->parserOutput, $this->page, $this->parserOptions);
}
// Make sure file cache is not used on uncacheable content.
// Output that has magic words in it can still use the parser cache
// (if enabled), though it will generally expire sooner.
if (!$this->parserOutput->isCacheable() || $this->parserOutput->containsOldMagic()) {
$wgUseFileCache = false;
}
if ($isCurrent) {
$this->page->doCascadeProtectionUpdates($this->parserOutput);
}
return true;
}