本文整理汇总了PHP中ParserOutput::getModuleStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOutput::getModuleStyles方法的具体用法?PHP ParserOutput::getModuleStyles怎么用?PHP ParserOutput::getModuleStyles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOutput
的用法示例。
在下文中一共展示了ParserOutput::getModuleStyles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: onRejectParserCacheValue
/**
* Reject parser cache values that are for GeSHi since those
* ResourceLoader modules no longer exist
*
* @param ParserOutput $parserOutput
* @param WikiPage|Article $page
* @param ParserOptions $popts
* @return bool
*/
public static function onRejectParserCacheValue(ParserOutput $parserOutput, $page, ParserOptions $popts)
{
foreach ($parserOutput->getModuleStyles() as $module) {
if (strpos($module, 'ext.geshi.') === 0) {
$page->getTitle()->purgeSquid();
return false;
}
}
return true;
}