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


PHP ApplicationFactory::getCache方法代码示例

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


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

示例1: checkForRequestedUpdateByPagePurge

 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $cache->setKey(ArticlePurge::newCacheId($this->parser->getTitle()->getArticleID()));
     if ($cache->get()) {
         $cache->delete();
         $parserData->updateStore();
     }
     return true;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:15,代码来源:ParserAfterTidy.php

示例2: checkForRequestedUpdateByPagePurge

 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key)) {
         $cache->delete($key);
         $parserData->updateStore();
     }
     return true;
 }
开发者ID:bogota,项目名称:SemanticMediaWiki,代码行数:19,代码来源:ParserAfterTidy.php

示例3: updateStore

 private function updateStore($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $cache->setKey(FactboxCache::newCacheId($this->getTitle()->getArticleID()))->delete();
     // TODO
     // Rebuild the factbox
     // Set a different updateIndentifier to ensure that the updateJob
     // will force a comparison of old/new data during the store update
     $parserData->getSemanticData()->setUpdateIdentifier('update-job');
     $parserData->disableBackgroundUpdateJobs();
     $parserData->updateStore();
     return true;
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:13,代码来源:UpdateJob.php

示例4: checkForRequestedUpdateByPagePurge

 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     // Only carry out a purge where InTextAnnotationParser have set
     // an appropriate context reference otherwise it is assumed that the hook
     // call is part of another non SMW related parse
     if ($parserData->getSemanticData()->getSubject()->getContextReference() === null) {
         return true;
     }
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key) && $cache->fetch($key)) {
         $cache->delete($key);
         $parserData->updateStore();
     }
     return true;
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:25,代码来源:ParserAfterTidy.php

示例5: checkForRequestedUpdateByPagePurge

 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     // Only carry out a purge where InTextAnnotationParser have set
     // an appropriate context reference otherwise it is assumed that the hook
     // call is part of another non SMW related parse
     if ($parserData->getSemanticData()->getSubject()->getContextReference() === null) {
         return true;
     }
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key) && $cache->fetch($key)) {
         $cache->delete($key);
         // Set a timestamp explicitly to create a new hash for the property
         // table change row differ and force a data comparison (this doesn't
         // change the _MDAT annotation)
         $parserData->getSemanticData()->setLastModified(wfTimestamp(TS_UNIX));
         $parserData->updateStore();
     }
     return true;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:29,代码来源:ParserAfterTidy.php


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