2 # DO NOT EDIT - This file is being maintained by Chef
4 $wgEnableWikibaseRepo = true;
5 $wgEnableWikibaseClient = true;
7 require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
8 require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
9 // Include Wikibase.searchindex.php to include string and text values in the full text index:
10 require_once "$IP/extensions/Wikibase/repo/config/Wikibase.searchindex.php";
12 # Adapted from $IP/extensions/Wikibase/repo/config/Wikibase.example.php
13 call_user_func( function() {
14 global $wgContentHandlerUseDB,
17 $wgNamespacesToBeSearchedDefault,
20 $wgContentHandlerUseDB = true;
24 // Define custom namespaces. Use these exact constant names.
25 define( 'WB_NS_ITEM', $baseNs );
26 define( 'WB_NS_ITEM_TALK', $baseNs + 1 );
27 define( 'WB_NS_PROPERTY', $baseNs + 2 );
28 define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );
30 // Register extra namespaces.
31 $wgExtraNamespaces[WB_NS_ITEM] = 'Item';
32 $wgExtraNamespaces[WB_NS_ITEM_TALK] = 'Item_talk';
33 $wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
34 $wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';
36 // Tell Wikibase which namespace to use for which kind of entity
37 $wgWBRepoSettings['entityNamespaces']['item'] = WB_NS_ITEM;
38 $wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY;
40 // Make sure we use the same keys on repo and clients, so we can share cached objects.
41 $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname . ':WBL/' . rawurlencode( WBL_VERSION );
43 // Include Wikibase items in the regular search result by default
44 $wgNamespacesToBeSearchedDefault[WB_NS_ITEM] = true;
46 // the special group includes all the sites in the specialSiteLinkGroups,
47 // grouped together in a 'Pages linked to other sites' section.
48 $wgWBRepoSettings['siteLinkGroups'] = [ 'special' ];
50 // these are the site_group codes as listed in the sites table
51 $wgWBRepoSettings['specialSiteLinkGroups'] = ['osm'];
54 // Adapted from "$IP/extensions/Wikibase/client/ExampleSettings.php";
56 // The global site ID by which this wiki is known on the repo.
57 // Defaults to $wgDBname.
58 // $wgWBClientSettings['siteGlobalID'] = "osm";
59 // $wgWBClientSettings['injectRecentChanges'] = true;
60 // $wgWBClientSettings['showExternalRecentChanges'] = true;
62 $wgWBClientSettings['namespaces'] = [ NS_MAIN ];
64 // no edit rights for anonymous users
65 $wgGroupPermissions['*']['item-term'] = false;
66 $wgGroupPermissions['*']['item-merge'] = false;
67 $wgGroupPermissions['*']['item-redirect'] = false;
68 $wgGroupPermissions['*']['property-term'] = false;
69 $wgGroupPermissions['*']['property-create'] = false;
71 // Logged-in users can edit statements, but disable merge/redirect/creating props
72 $wgGroupPermissions['user']['item-term'] = true;
73 $wgGroupPermissions['user']['item-merge'] = false;
74 $wgGroupPermissions['user']['item-redirect'] = false;
75 $wgGroupPermissions['user']['property-term'] = true;
76 $wgGroupPermissions['user']['property-create'] = false;
78 // data-admin group should be the only one creating properties
79 $wgGroupPermissions['data-admin']['item-redirect'] = true;
80 $wgGroupPermissions['data-admin']['item-merge'] = true;
81 $wgGroupPermissions['data-admin']['property-create'] = true;
84 // See https://www.mediawiki.org/wiki/Wikibase/Installation/Advanced_configuration#Define_links_for_external_identifiers
85 $wgWBRepoSettings['formatterUrlProperty'] = 'P8';
87 // Disable Wikibase searchbox with this hack (hopefully Wikibase will implement support for it soon)
88 // See https://phabricator.wikimedia.org/T205560
89 $wgResourceModules['wikibase.ui.entitysearch']['scripts'] = [];