本文整理汇总了PHP中SMW\ApplicationFactory::newMwCollaboratorFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationFactory::newMwCollaboratorFactory方法的具体用法?PHP ApplicationFactory::newMwCollaboratorFactory怎么用?PHP ApplicationFactory::newMwCollaboratorFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMW\ApplicationFactory
的用法示例。
在下文中一共展示了ApplicationFactory::newMwCollaboratorFactory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerConnectionProviders
private function registerConnectionProviders()
{
$mwCollaboratorFactory = $this->applicationFactory->newMwCollaboratorFactory();
$connectionManager = new ConnectionManager();
$connectionManager->registerConnectionProvider(DB_MASTER, $mwCollaboratorFactory->newLazyDBConnectionProvider(DB_MASTER));
$connectionManager->registerConnectionProvider(DB_SLAVE, $mwCollaboratorFactory->newLazyDBConnectionProvider(DB_SLAVE));
$connectionManager->registerConnectionProvider('mw.db', $mwCollaboratorFactory->newMediaWikiDatabaseConnectionProvider());
}
示例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;
}
示例3: registerConnectionProviders
private function registerConnectionProviders()
{
$mwCollaboratorFactory = $this->applicationFactory->newMwCollaboratorFactory();
$connectionManager = new ConnectionManager();
$connectionManager->registerConnectionProvider(DB_MASTER, $mwCollaboratorFactory->newLazyDBConnectionProvider(DB_MASTER));
$connectionManager->registerConnectionProvider(DB_SLAVE, $mwCollaboratorFactory->newLazyDBConnectionProvider(DB_SLAVE));
$connectionManager->registerConnectionProvider('mw.db', $mwCollaboratorFactory->newMediaWikiDatabaseConnectionProvider());
// Connection can be used to redirect queries to another DB cluster
$queryengineConnectionProvider = $mwCollaboratorFactory->newMediaWikiDatabaseConnectionProvider();
$queryengineConnectionProvider->resetTransactionProfiler();
$connectionManager->registerConnectionProvider('mw.db.queryengine', $queryengineConnectionProvider);
}
示例4: matchWikiPageLastModifiedToRevisionLastModified
private function matchWikiPageLastModifiedToRevisionLastModified($title)
{
if ($this->getParameter('pm') !== ($this->getParameter('pm') | SMW_UJ_PM_CLASTMDATE)) {
return false;
}
$lastModified = $this->getWikiPageLastModifiedTimestamp(DIWikiPage::newFromTitle($title));
if ($lastModified === \WikiPage::factory($title)->getTimestamp()) {
$pageUpdater = $this->applicationFactory->newMwCollaboratorFactory()->newPageUpdater();
$pageUpdater->addPage($title);
$pageUpdater->doPurgeParserCache();
return true;
}
return false;
}
示例5: 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;
}
示例6: updateSemanticData
private function updateSemanticData(Title $title, WikiPage $wikiPage, $revision)
{
$this->processSemantics = $revision !== null && $this->isSemanticEnabledNamespace($title);
if (!$this->processSemantics) {
return $this->semanticData = new SemanticData($this->getSubject());
}
$pageInfoProvider = $this->applicationFactory->newMwCollaboratorFactory()->newPageInfoProvider($wikiPage, $revision, User::newFromId($revision->getUser()));
$propertyAnnotator = $this->applicationFactory->newPropertyAnnotatorFactory()->newPredefinedPropertyAnnotator($this->semanticData, $pageInfoProvider);
$propertyAnnotator->addAnnotation();
}
示例7: createTable
/**
* Returns a formatted factbox table
*
* @since 1.9
*
* @param SMWSemanticData $semanticData
*
* @return string|null
*/
protected function createTable(SemanticData $semanticData)
{
$this->htmlTableRenderer = $this->applicationFactory->newMwCollaboratorFactory()->newHtmlTableRenderer();
$text = '';
// Hook deprecated with SMW 1.9 and will vanish with SMW 1.11
wfRunHooks('smwShowFactbox', array(&$text, $semanticData));
// Hook since 1.9
if (wfRunHooks('SMW::Factbox::BeforeContentGeneration', array(&$text, $semanticData))) {
$this->getTableHeader($semanticData->getSubject());
$this->getTableContent($semanticData);
$text .= Html::rawElement('div', array('class' => 'smwfact'), $this->htmlTableRenderer->getHeaderItems() . $this->htmlTableRenderer->getHtml(array('class' => 'smwfacttable')));
}
return $text;
}