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


PHP ApplicationFactory::newCacheFactory方法代码示例

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


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

示例1: newMasterQueryEngine

 /**
  * @since 2.2
  *
  * @return QueryEngine
  */
 public function newMasterQueryEngine()
 {
     $engineOptions = new EngineOptions();
     $propertyHierarchyLookup = new PropertyHierarchyLookup($this->store, $this->applicationFactory->newCacheFactory()->newFixedInMemoryCache(500));
     $propertyHierarchyLookup->setSubcategoryDepth($this->applicationFactory->getSettings()->get('smwgQSubcategoryDepth'));
     $propertyHierarchyLookup->setSubpropertyDepth($this->applicationFactory->getSettings()->get('smwgQSubpropertyDepth'));
     $circularReferenceGuard = new CircularReferenceGuard('sparql-query');
     $circularReferenceGuard->setMaxRecursionDepth(2);
     $compoundConditionBuilder = new CompoundConditionBuilder($engineOptions);
     $compoundConditionBuilder->setCircularReferenceGuard($circularReferenceGuard);
     $compoundConditionBuilder->setPropertyHierarchyLookup($propertyHierarchyLookup);
     $queryEngine = new QueryEngine($this->store->getConnection('sparql'), $compoundConditionBuilder, new QueryResultFactory($this->store), $engineOptions);
     return $queryEngine;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:19,代码来源:SPARQLStoreFactory.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: newEntityLookup

 /**
  * @since 2.5
  *
  * @return EntityLookup
  */
 public function newEntityLookup()
 {
     $settings = $this->applicationFactory->getSettings();
     $directEntityLookup = new DirectEntityLookup($this->store);
     if ($settings->get('smwgValueLookupCacheType') === CACHE_NONE) {
         return $directEntityLookup;
     }
     $circularReferenceGuard = new CircularReferenceGuard('vl:store');
     $circularReferenceGuard->setMaxRecursionDepth(2);
     $cacheFactory = $this->applicationFactory->newCacheFactory();
     $blobStore = $cacheFactory->newBlobStore('smw:vl:store', $settings->get('smwgValueLookupCacheType'), $settings->get('smwgValueLookupCacheLifetime'));
     $cachedEntityLookup = new CachedEntityLookup($directEntityLookup, new RedirectTargetLookup($this->store, $circularReferenceGuard), $blobStore);
     $cachedEntityLookup->setCachedLookupFeatures($settings->get('smwgValueLookupFeatures'));
     return $cachedEntityLookup;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:20,代码来源:SQLStoreFactory.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::newCacheFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。