From: Tom Hughes Date: Thu, 28 Apr 2022 18:22:02 +0000 (+0100) Subject: Update repo configuration for Wikibase X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/586ac89854fe37ae4d9a0b8dcda6797535cafb49?ds=sidebyside Update repo configuration for Wikibase --- 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,