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


PHP ApplicationFactory::newParserData方法代码示例

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


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

示例1: performUpdate

 protected function performUpdate()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     $parserData = $this->applicationFactory->newParserData($this->parser->getTitle(), $this->parser->getOutput());
     $this->updateAnnotionsForAfterParse($this->applicationFactory->newPropertyAnnotatorFactory(), $parserData->getSemanticData());
     $parserData->pushSemanticDataToParserOutput();
     $this->checkForRequestedUpdateByPagePurge($parserData);
     return true;
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:9,代码来源:ParserAfterTidy.php

示例2: performUpdate

 private function performUpdate()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     $filePage = $this->makeFilePage();
     $parserData = $this->applicationFactory->newParserData($this->file->getTitle(), $filePage->getParserOutput($this->makeCanonicalParserOptions()));
     $pageInfoProvider = $this->applicationFactory->newMwCollaboratorFactory()->newPageInfoProvider($filePage);
     $propertyAnnotator = $this->applicationFactory->newPropertyAnnotatorFactory()->newPredefinedPropertyAnnotator($parserData->getSemanticData(), $pageInfoProvider);
     $propertyAnnotator->addAnnotation();
     $parserData->pushSemanticDataToParserOutput();
     $parserData->updateStore();
     return true;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:12,代码来源:FileUpload.php

示例3: performUpdate

 protected function performUpdate()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     $parserData = $this->applicationFactory->newParserData($this->parser->getTitle(), $this->parser->getOutput());
     $propertyAnnotator = $this->applicationFactory->newPropertyAnnotatorFactory()->newSortkeyPropertyAnnotator($parserData->getSemanticData(), $this->parser->getDefaultSort());
     $propertyAnnotator->addAnnotation();
     $propertyAnnotator = $this->applicationFactory->newPropertyAnnotatorFactory()->newCategoryPropertyAnnotator($parserData->getSemanticData(), $this->parser->getOutput()->getCategoryLinks());
     $propertyAnnotator->addAnnotation();
     $parserData->pushSemanticDataToParserOutput();
     $this->checkForRequestedUpdateByPagePurge($parserData);
     return true;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:12,代码来源:ParserAfterTidy.php

示例4: process

 /**
  * @since 1.9
  *
  * @return true
  */
 public function process()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     /**
      * @var ParserData $parserData
      */
     $parserData = $this->applicationFactory->newParserData($this->linksUpdate->getTitle(), $this->linksUpdate->getParserOutput());
     if ($parserData->getSemanticData()->isEmpty() && ($semanticData = $this->refetchSemanticData()) instanceof SemanticData) {
         $parserData->setSemanticData($semanticData);
     }
     $parserData->updateStore();
     return true;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:18,代码来源:LinksUpdateConstructed.php

示例5: process

 /**
  * @since 1.9
  *
  * @return true
  */
 public function process()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     $title = $this->linksUpdate->getTitle();
     /**
      * @var ParserData $parserData
      */
     $parserData = $this->applicationFactory->newParserData($title, $this->linksUpdate->getParserOutput());
     if ($this->isSemanticEnabledNamespace($title) && $parserData->getSemanticData()->isEmpty()) {
         $this->updateEmptySemanticData($parserData, $title);
     }
     $parserData->updateStore();
     return true;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:19,代码来源:LinksUpdateConstructed.php

示例6: process

 /**
  * @since 1.9
  *
  * @return true
  */
 public function process()
 {
     $this->applicationFactory = ApplicationFactory::getInstance();
     $title = $this->linksUpdate->getTitle();
     /**
      * @var ParserData $parserData
      */
     $parserData = $this->applicationFactory->newParserData($title, $this->linksUpdate->getParserOutput());
     if ($this->isSemanticEnabledNamespace($title) && $parserData->getSemanticData()->isEmpty()) {
         $this->updateEmptySemanticData($parserData, $title);
     }
     // Push updates on properties directly without delay
     if ($title->getNamespace() === SMW_NS_PROPERTY) {
         $this->enabledDeferredUpdate = false;
     }
     $parserData->updateStore($this->enabledDeferredUpdate);
     return true;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:23,代码来源:LinksUpdateConstructed.php

示例7: needToParsePageContentBeforeUpdate

 private function needToParsePageContentBeforeUpdate()
 {
     $contentParser = $this->applicationFactory->newContentParser($this->getTitle());
     $contentParser->forceToUseParser();
     $contentParser->parse();
     if (!$contentParser->getOutput() instanceof ParserOutput) {
         $this->setLastError($contentParser->getErrors());
         return false;
     }
     $parserData = $this->applicationFactory->newParserData($this->getTitle(), $contentParser->getOutput());
     return $this->updateStore($parserData);
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:12,代码来源:UpdateJob.php

示例8: needToParsePageContentBeforeUpdate

 /**
  * SMW_UJ_PM_NP = new Parser to avoid "Parser state cleared" exception
  */
 private function needToParsePageContentBeforeUpdate()
 {
     $contentParser = $this->applicationFactory->newContentParser($this->getTitle());
     if ($this->getParameter('pm') === ($this->getParameter('pm') | SMW_UJ_PM_NP)) {
         $contentParser->setParser(new \Parser($GLOBALS['wgParserConf']));
     }
     $contentParser->parse();
     if (!$contentParser->getOutput() instanceof ParserOutput) {
         $this->setLastError($contentParser->getErrors());
         return false;
     }
     $parserData = $this->applicationFactory->newParserData($this->getTitle(), $contentParser->getOutput());
     return $this->updateStore($parserData);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:17,代码来源:UpdateJob.php

示例9: performUpdate

 private function performUpdate()
 {
     /**
      * @var ParserData $parserData
      */
     $parserData = $this->applicationFactory->newParserData($this->parser->getTitle(), $this->parser->getOutput());
     /**
      * Performs [[link::syntax]] parsing and adding of property annotations
      * to the ParserOutput
      *
      * @var InTextAnnotationParser
      */
     $inTextAnnotationParser = $this->applicationFactory->newInTextAnnotationParser($parserData);
     $inTextAnnotationParser->setRedirectTarget($this->getRedirectTarget());
     $inTextAnnotationParser->parse($this->text);
     $parserData->setSemanticDataStateToParserOutputProperty();
     return true;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:18,代码来源:InternalParseBeforeLinks.php


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