本文整理匯總了PHP中ParserOutput::setSpeculativeRevIdUsed方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParserOutput::setSpeculativeRevIdUsed方法的具體用法?PHP ParserOutput::setSpeculativeRevIdUsed怎麽用?PHP ParserOutput::setSpeculativeRevIdUsed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ParserOutput
的用法示例。
在下文中一共展示了ParserOutput::setSpeculativeRevIdUsed方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getVariableValue
//.........這裏部分代碼省略.........
} else {
$value = '';
}
break;
case 'subjectpagename':
$subjPage = $this->mTitle->getSubjectPage();
$value = wfEscapeWikiText($subjPage->getPrefixedText());
break;
case 'subjectpagenamee':
$subjPage = $this->mTitle->getSubjectPage();
$value = wfEscapeWikiText($subjPage->getPrefixedURL());
break;
case 'pageid':
// requested in bug 23427
$pageid = $this->getTitle()->getArticleID();
if ($pageid == 0) {
# 0 means the page doesn't exist in the database,
# which means the user is previewing a new page.
# The vary-revision flag must be set, because the magic word
# will have a different value once the page is saved.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{PAGEID}} used in a new page, setting vary-revision...\n");
}
$value = $pageid ? $pageid : null;
break;
case 'revisionid':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned.
$this->mOutput->setFlag('vary-revision-id');
wfDebug(__METHOD__ . ": {{REVISIONID}} used, setting vary-revision-id...\n");
$value = $this->mRevisionId;
if (!$value && $this->mOptions->getSpeculativeRevIdCallback()) {
$value = call_user_func($this->mOptions->getSpeculativeRevIdCallback());
$this->mOutput->setSpeculativeRevIdUsed($value);
}
break;
case 'revisionday':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONDAY}} used, setting vary-revision...\n");
$value = intval(substr($this->getRevisionTimestamp(), 6, 2));
break;
case 'revisionday2':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONDAY2}} used, setting vary-revision...\n");
$value = substr($this->getRevisionTimestamp(), 6, 2);
break;
case 'revisionmonth':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONMONTH}} used, setting vary-revision...\n");
$value = substr($this->getRevisionTimestamp(), 4, 2);
break;
case 'revisionmonth1':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONMONTH1}} used, setting vary-revision...\n");
$value = intval(substr($this->getRevisionTimestamp(), 4, 2));
break;
case 'revisionyear':
# Let the edit saving system know we should parse the page