本文整理汇总了PHP中ParserOutput::addOutputPageMetadata方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOutput::addOutputPageMetadata方法的具体用法?PHP ParserOutput::addOutputPageMetadata怎么用?PHP ParserOutput::addOutputPageMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOutput
的用法示例。
在下文中一共展示了ParserOutput::addOutputPageMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: braceSubstitution
//.........这里部分代码省略.........
}
# Load from database
if (!$found && $title) {
if (!Profiler::instance()->isPersistent()) {
# Too many unique items can kill profiling DBs/collectors
$titleProfileIn = __METHOD__ . "-title-" . $title->getPrefixedDBkey();
wfProfileIn($titleProfileIn);
// template in
}
wfProfileIn(__METHOD__ . '-loadtpl');
if (!$title->isExternal()) {
if ($title->isSpecialPage() && $this->mOptions->getAllowSpecialInclusion() && $this->ot['html']) {
// Pass the template arguments as URL parameters.
// "uselang" will have no effect since the Language object
// is forced to the one defined in ParserOptions.
$pageArgs = array();
for ($i = 0; $i < $args->getLength(); $i++) {
$bits = $args->item($i)->splitArg();
if (strval($bits['index']) === '') {
$name = trim($frame->expand($bits['name'], PPFrame::STRIP_COMMENTS));
$value = trim($frame->expand($bits['value']));
$pageArgs[$name] = $value;
}
}
// Create a new context to execute the special page
$context = new RequestContext();
$context->setTitle($title);
$context->setRequest(new FauxRequest($pageArgs));
$context->setUser($this->getUser());
$context->setLanguage($this->mOptions->getUserLangObj());
$ret = SpecialPageFactory::capturePath($title, $context);
if ($ret) {
$text = $context->getOutput()->getHTML();
$this->mOutput->addOutputPageMetadata($context->getOutput());
$found = true;
$isHTML = true;
$this->disableCache();
}
} elseif (MWNamespace::isNonincludable($title->getNamespace())) {
$found = false;
# access denied
wfDebug(__METHOD__ . ": template inclusion denied for " . $title->getPrefixedDBkey() . "\n");
} else {
list($text, $title) = $this->getTemplateDom($title);
if ($text !== false) {
$found = true;
$isChildObj = true;
}
}
# If the title is valid but undisplayable, make a link to it
if (!$found && ($this->ot['html'] || $this->ot['pre'])) {
$text = "[[:{$titleText}]]";
$found = true;
}
} elseif ($title->isTrans()) {
# Interwiki transclusion
if ($this->ot['html'] && !$forceRawInterwiki) {
$text = $this->interwikiTransclude($title, 'render');
$isHTML = true;
} else {
$text = $this->interwikiTransclude($title, 'raw');
# Preprocess it like a template
$text = $this->preprocessToDom($text, self::PTD_FOR_INCLUSION);
$isChildObj = true;
}
$found = true;