本文整理汇总了PHP中ParserOutput::getFileSearchOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOutput::getFileSearchOptions方法的具体用法?PHP ParserOutput::getFileSearchOptions怎么用?PHP ParserOutput::getFileSearchOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOutput
的用法示例。
在下文中一共展示了ParserOutput::getFileSearchOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parserOutputIsVersioned
/**
* Check that ParserOutput object has file/template versions
* Note that ParserOutput::mImageTimeKeys wasn't always there
* @param ParserOutput $pOut
* @return bool
*/
public static function parserOutputIsVersioned(ParserOutput $pOut)
{
return $pOut->getTemplateIds() !== null && $pOut->getFileSearchOptions() !== null;
}
示例2: addParserOutputMetadata
/**
* Add all metadata associated with a ParserOutput object, but without the actual HTML. This
* includes categories, language links, ResourceLoader modules, effects of certain magic words,
* and so on.
*
* @since 1.24
* @param ParserOutput $parserOutput
*/
public function addParserOutputMetadata($parserOutput)
{
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
$this->addCategoryLinks($parserOutput->getCategories());
$this->setIndicators($parserOutput->getIndicators());
$this->mNewSectionLink = $parserOutput->getNewSection();
$this->mHideNewSectionLink = $parserOutput->getHideNewSection();
$this->mParseWarnings = $parserOutput->getWarnings();
if (!$parserOutput->isCacheable()) {
$this->enableClientCache(false);
}
$this->mNoGallery = $parserOutput->getNoGallery();
$this->mHeadItems = array_merge($this->mHeadItems, $parserOutput->getHeadItems());
$this->addModules($parserOutput->getModules());
$this->addModuleScripts($parserOutput->getModuleScripts());
$this->addModuleStyles($parserOutput->getModuleStyles());
$this->addJsConfigVars($parserOutput->getJsConfigVars());
$this->mPreventClickjacking = $this->mPreventClickjacking || $parserOutput->preventClickjacking();
// Template versioning...
foreach ((array) $parserOutput->getTemplateIds() as $ns => $dbks) {
if (isset($this->mTemplateIds[$ns])) {
$this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
} else {
$this->mTemplateIds[$ns] = $dbks;
}
}
// File versioning...
foreach ((array) $parserOutput->getFileSearchOptions() as $dbk => $data) {
$this->mImageTimeKeys[$dbk] = $data;
}
// Hooks registered in the object
$parserOutputHooks = $this->getConfig()->get('ParserOutputHooks');
foreach ($parserOutput->getOutputHooks() as $hookInfo) {
list($hookName, $data) = $hookInfo;
if (isset($parserOutputHooks[$hookName])) {
call_user_func($parserOutputHooks[$hookName], $this, $parserOutput, $data);
}
}
// Link flags are ignored for now, but may in the future be
// used to mark individual language links.
$linkFlags = array();
Hooks::run('LanguageLinks', array($this->getTitle(), &$this->mLanguageLinks, &$linkFlags));
Hooks::run('OutputPageParserOutput', array(&$this, $parserOutput));
}
示例3: setRevIncludes
/**
* Set template and image versions from parsing a revision
* @param Title $title
* @param int $revId
* @param ParserOutput $rev
* @return void
*/
public static function setRevIncludes(Title $title, $revId, ParserOutput $pOut)
{
global $wgMemc;
$key = self::getCacheKey($title, $revId);
# Get the template/file versions used...
$versions = array($pOut->getTemplateIds(), $pOut->getFileSearchOptions());
# Save to cache (check cache expiry for dynamic elements)...
$data = FlaggedRevs::makeMemcObj($versions);
$wgMemc->set($key, $data, $pOut->getCacheExpiry());
}