当前位置: 首页>>代码示例>>PHP>>正文


PHP ParserOutput::getTemplateIds方法代码示例

本文整理汇总了PHP中ParserOutput::getTemplateIds方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOutput::getTemplateIds方法的具体用法?PHP ParserOutput::getTemplateIds怎么用?PHP ParserOutput::getTemplateIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParserOutput的用法示例。


在下文中一共展示了ParserOutput::getTemplateIds方法的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;
 }
开发者ID:crippsy14,项目名称:orange-smorange,代码行数:10,代码来源:FlaggedRevs.class.php

示例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));
 }
开发者ID:GoProjectOwner,项目名称:mediawiki,代码行数:52,代码来源:OutputPage.php

示例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());
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:FRInclusionCache.php


注:本文中的ParserOutput::getTemplateIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。