本文整理汇总了PHP中ParserOptions::getSpeculativeRevIdCallback方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOptions::getSpeculativeRevIdCallback方法的具体用法?PHP ParserOptions::getSpeculativeRevIdCallback怎么用?PHP ParserOptions::getSpeculativeRevIdCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOptions
的用法示例。
在下文中一共展示了ParserOptions::getSpeculativeRevIdCallback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVariableValue
//.........这里部分代码省略.........
$talkPage = $this->mTitle->getTalkPage();
$value = wfEscapeWikiText($talkPage->getPrefixedURL());
} 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;