From 586ac89854fe37ae4d9a0b8dcda6797535cafb49 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 28 Apr 2022 19:22:02 +0100 Subject: [PATCH] Update repo configuration for Wikibase --- .../default/mw-ext-Wikibase.inc.php.erb | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/cookbooks/wiki/templates/default/mw-ext-Wikibase.inc.php.erb b/cookbooks/wiki/templates/default/mw-ext-Wikibase.inc.php.erb index efb01cf77..0b69f5c94 100644 --- a/cookbooks/wiki/templates/default/mw-ext-Wikibase.inc.php.erb +++ b/cookbooks/wiki/templates/default/mw-ext-Wikibase.inc.php.erb @@ -1,6 +1,9 @@ WB_NS_ITEM, + 'property' => WB_NS_PROPERTY, + ]; + + $hookContainer = MediaWikiServices::getInstance()->getHookContainer(); + $hookContainer->run( 'WikibaseRepoEntityNamespaces', [ &$entityNamespaces ] ); + + return [ + $settings->getSetting( 'localEntitySourceName' ) => [ + 'entityNamespaces' => $entityNamespaces, + 'repoDatabase' => false, + 'baseUri' => $wgServer . '/entity/', + 'rdfNodeNamespacePrefix' => 'wd', + 'rdfPredicateNamespacePrefix' => '', + 'interwikiPrefix' => '', + ], + ]; + }; // Make sure we use the same keys on repo and clients, so we can share cached objects. - $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname; + $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname . ':WBL'; + $wgWBRepoSettings['sharedCacheKeyGroup'] = $wgDBname; // Include Wikibase items in the regular search result by default $wgNamespacesToBeSearchedDefault[WB_NS_ITEM] = true; @@ -91,7 +112,7 @@ define( 'WB_REPO_NS_PROPERTY', $baseRepoNs + 2 ); $wgWBClientSettings['entitySources'] = [ 'local' => [ - 'repoDatabase' => 'repo', + 'repoDatabase' => $wgDBname, 'baseUri' => $wgWBClientSettings['repoUrl'] . '/entity', 'entityNamespaces' => [ 'item' => WB_REPO_NS_ITEM, -- 2.39.5