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


PHP LinkCache::clear方法代码示例

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


在下文中一共展示了LinkCache::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runParser

 /**
  * Parse the text from a given Revision
  *
  * @param Revision $revision
  */
 function runParser(Revision $revision)
 {
     $content = $revision->getContent();
     $content->getParserOutput($revision->getTitle(), $revision->getId());
     if ($this->clearLinkCache) {
         $this->linkCache->clear();
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:13,代码来源:benchmarkParse.php

示例2: showArticle

 /**
  * After we've either updated or inserted the article, update
  * the link tables and redirect to the new page.
  */
 function showArticle($text, $subtitle, $sectionanchor = '')
 {
     global $wgUseDumbLinkUpdate, $wgAntiLockFlags, $wgOut, $wgUser, $wgLinkCache, $wgEnotif;
     global $wgUseEnotif;
     $fname = 'Article::showArticle';
     wfProfileIn($fname);
     $wgLinkCache = new LinkCache();
     if (!$wgUseDumbLinkUpdate) {
         # Preload links to reduce lock time
         if ($wgAntiLockFlags & ALF_PRELOAD_LINKS) {
             $wgLinkCache->preFill($this->mTitle);
             $wgLinkCache->clear();
         }
     }
     # Parse the text and replace links with placeholders
     $wgOut = new OutputPage();
     # Pass the current title along in case we're creating a wiki page
     # which is different than the currently displayed one (e.g. image
     # pages created on file uploads); otherwise, link updates will
     # go wrong.
     $wgOut->addWikiTextWithTitle($text, $this->mTitle);
     if (!$wgUseDumbLinkUpdate) {
         # Move the current links back to the second register
         $wgLinkCache->swapRegisters();
         # Get old version of link table to allow incremental link updates
         # Lock this data now since it is needed for an update
         $wgLinkCache->forUpdate(true);
         $wgLinkCache->preFill($this->mTitle);
         # Swap this old version back into its rightful place
         $wgLinkCache->swapRegisters();
     }
     if ($this->isRedirect($text)) {
         $r = 'redirect=no';
     } else {
         $r = '';
     }
     $wgOut->redirect($this->mTitle->getFullURL($r) . $sectionanchor);
     wfProfileOut($fname);
 }
开发者ID:BackupTheBerlios,项目名称:enotifwiki,代码行数:43,代码来源:Article.php


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