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


PHP ApplicationFactory::getStore方法代码示例

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


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

示例1: __construct

 /**
  * @since  1.9
  *
  * @param Title $title
  * @param array $params job parameters
  * @param integer $id job id
  */
 public function __construct(Title $title, $params = array(), $id = 0)
 {
     parent::__construct('SMW\\UpdateDispatcherJob', $title, $params, $id);
     $this->removeDuplicates = true;
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->setStore($this->applicationFactory->getStore());
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:14,代码来源:UpdateDispatcherJob.php

示例2: doUpdate

 private function doUpdate()
 {
     LinkCache::singleton()->clear();
     $this->applicationFactory = ApplicationFactory::getInstance();
     if ($this->getTitle()->exists()) {
         return $this->doPrepareForUpdate();
     }
     $this->applicationFactory->getStore()->clearData(DIWikiPage::newFromTitle($this->getTitle()));
     return true;
 }
开发者ID:ReachingOut,项目名称:SemanticMediaWiki,代码行数:10,代码来源:UpdateJob.php

示例3: getWikiPageLastModifiedTimestamp

 /**
  * Convenience method to find last modified MW timestamp for a subject that
  * has been added using the storage-engine.
  */
 private function getWikiPageLastModifiedTimestamp(DIWikiPage $wikiPage)
 {
     $dataItems = $this->applicationFactory->getStore()->getPropertyValues($wikiPage, new DIProperty('_MDAT'));
     if ($dataItems !== array()) {
         return end($dataItems)->getMwTimestamp(TS_MW);
     }
     return 0;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:12,代码来源:UpdateJob.php

示例4: run

 /**
  * @see Job::run
  *
  * @since  2.3
  */
 public function run()
 {
     $this->pageUpdater = $this->applicationFactory->newMwCollaboratorFactory()->newPageUpdater();
     $this->store = $this->applicationFactory->getStore();
     if ($this->hasParameter('limit')) {
         $this->limit = $this->getParameter('limit');
     }
     if ($this->hasParameter('offset')) {
         $this->offset = $this->getParameter('offset');
     }
     if ($this->hasParameter('idlist')) {
         $this->findEmbeddedQueryTargetLinksBatches($this->getParameter('idlist'));
     }
     $this->pageUpdater->addPage($this->getTitle());
     $this->pageUpdater->doPurgeParserCache();
     Hooks::run('SMW::Job::AfterParserCachePurgeComplete', array($this));
     return true;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:23,代码来源:ParserCachePurgeJob.php

示例5: newHtmlContentBuilder

 private function newHtmlContentBuilder($webRequest)
 {
     $htmlContentBuilder = new HtmlContentBuilder($this->applicationFactory->getStore(), $this->subjectDV->getDataItem());
     $htmlContentBuilder->setOption('dir', $webRequest->getVal('dir'));
     $htmlContentBuilder->setOption('printable', $webRequest->getVal('printable'));
     $htmlContentBuilder->setOption('offset', $webRequest->getVal('offset'));
     $htmlContentBuilder->setOption('showInverse', $this->applicationFactory->getSettings()->get('smwgBrowseShowInverse'));
     $htmlContentBuilder->setOption('showAll', $this->applicationFactory->getSettings()->get('smwgBrowseShowAll'));
     $htmlContentBuilder->setOption('byApi', $this->applicationFactory->getSettings()->get('smwgBrowseByApi'));
     return $htmlContentBuilder;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:11,代码来源:SpecialBrowse.php

示例6: matchWikiPageLastModifiedToRevisionLastModified

 private function matchWikiPageLastModifiedToRevisionLastModified($title)
 {
     if ($this->getParameter('pm') !== ($this->getParameter('pm') | SMW_UJ_PM_CLASTMDATE)) {
         return false;
     }
     $lastModified = $this->applicationFactory->getStore()->getWikiPageLastModifiedTimestamp(DIWikiPage::newFromTitle($title));
     if ($lastModified === \WikiPage::factory($title)->getTimestamp()) {
         $pageUpdater = $this->applicationFactory->newMwCollaboratorFactory()->newPageUpdater();
         $pageUpdater->addPage($title);
         $pageUpdater->doPurgeParserCache();
         return true;
     }
     return false;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:14,代码来源:UpdateJob.php

示例7: registerHooksForInternalUse

 private function registerHooksForInternalUse(ApplicationFactory $applicationFactory, DeferredRequestDispatchManager $deferredRequestDispatchManager)
 {
     $queryDependencyLinksStoreFactory = new QueryDependencyLinksStoreFactory();
     $queryDependencyLinksStore = $queryDependencyLinksStoreFactory->newQueryDependencyLinksStore($applicationFactory->getStore());
     $transitionalDiffStore = $applicationFactory->singleton('TransitionalDiffStore');
     /**
      * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMW::SQLStore::AfterDataUpdateComplete
      */
     $this->handlers['SMW::SQLStore::AfterDataUpdateComplete'] = function ($store, $semanticData, $compositePropertyTableDiffIterator) use($queryDependencyLinksStoreFactory, $queryDependencyLinksStore, $deferredRequestDispatchManager, $transitionalDiffStore) {
         // When in commandLine mode avoid deferred execution and run a process
         // within the same transaction
         $deferredRequestDispatchManager->isCommandLineMode($store->getOptions()->has('isCommandLineMode') ? $store->getOptions()->get('isCommandLineMode') : $GLOBALS['wgCommandLineMode']);
         $queryDependencyLinksStore->setStore($store);
         $subject = $semanticData->getSubject();
         $slot = $transitionalDiffStore->createSlotFrom($compositePropertyTableDiffIterator);
         $queryDependencyLinksStore->pruneOutdatedTargetLinks($subject, $compositePropertyTableDiffIterator);
         $entityIdListRelevanceDetectionFilter = $queryDependencyLinksStoreFactory->newEntityIdListRelevanceDetectionFilter($store, $compositePropertyTableDiffIterator);
         $jobParameters = $queryDependencyLinksStore->buildParserCachePurgeJobParametersFrom($entityIdListRelevanceDetectionFilter);
         $deferredRequestDispatchManager->scheduleParserCachePurgeJobWith($subject->getTitle(), $jobParameters);
         $fulltextSearchTableFactory = new FulltextSearchTableFactory();
         $textByChangeUpdater = $fulltextSearchTableFactory->newTextByChangeUpdater($store);
         $textByChangeUpdater->pushUpdates($compositePropertyTableDiffIterator, $deferredRequestDispatchManager, $slot);
         // Since we cannot predict as to when the slot is used and by whom,
         // schedule a job to ensure to be the last in-line to clean-up
         // any remaining slots for this transaction
         $deferredRequestDispatchManager->scheduleChronologyPurgeJobWith($subject->getTitle(), array('slot:id' => $slot));
         return true;
     };
     /**
      * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMW::Store::AfterQueryResultLookupComplete
      */
     $this->handlers['SMW::Store::AfterQueryResultLookupComplete'] = function ($store, &$result) use($queryDependencyLinksStore, $applicationFactory) {
         $queryDependencyLinksStore->setStore($store);
         $queryDependencyLinksStore->doUpdateDependenciesFrom($result);
         $applicationFactory->singleton('CachedQueryResultPrefetcher')->recordStats();
         return true;
     };
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:38,代码来源:HookRegistry.php


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