Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/wikioasis/mw-config/llms.txt

Use this file to discover all available pages before exploring further.

Wikibase.php configures the Wikibase extension for every wiki in the WikiOasis farm that has Wikibase enabled. Rather than a static configuration, it is driven by per-wiki ManageWiki settings — namespace IDs, the repo database, the repo URL, and feature flags are all resolved at runtime from $wmg* variables. The file configures both sides of Wikibase simultaneously: every Wikibase-enabled wiki is treated as a potential repo ($wgWBRepoSettings) and as a client of that repo ($wgWBClientSettings), with the entity source pointing locally to the same wiki’s database. The configuration is loaded conditionally by GlobalSettings.php only when Wikibase appears in the active extensions list for the current wiki.
Wikibase is loaded conditionally in GlobalSettings.php — the settings in Wikibase.php are only applied when $wi->isExtensionActive('Wikibase') returns true for the current wiki.

Entity Sources

The entity source is always named 'local' and points at the same database as the wiki itself. It is constructed as a PHP array before being assigned to both $wgWBRepoSettings and $wgWBClientSettings.
local
array
The single entity source definition shared by both repo and client settings.

Namespace IDs

Entity namespaces are controlled by per-wiki ManageWiki settings rather than hardcoded values.
Entity TypeManageWiki VariableApplies To
Item$wmgWikibaseRepoItemNamespaceIDRepo entity source, $wgWBRepoSettings['entityNamespaces']
Property$wmgWikibaseRepoPropertyNamespaceIDRepo entity source, $wgWBRepoSettings['entityNamespaces']
LexemeHardcoded 146Added only when WikibaseLexeme is active
Configure these values on a per-wiki basis via Special:ManageWiki/settings.

WikibaseLexeme Support

When the WikibaseLexeme extension is active for a wiki, Wikibase.php extends the entity source and repo settings to include lexemes:
if ( $wi->isExtensionActive( 'WikibaseLexeme' ) ) {
    $entitySources['local']['entityNamespaces']['lexeme'] = 146;
    $wgWBRepoSettings['entityNamespaces']['lexeme'] = 146;
}
Lexeme namespace 146 is added to both the entity source definition (so the client and the repo can locate lexeme entities) and to $wgWBRepoSettings['entityNamespaces'] (so the repo stores and serves them).
To enable WikibaseLexeme on a wiki, first ensure Wikibase itself is enabled, then enable WikibaseLexeme via Special:ManageWiki/extensions. The lexeme namespace (146) will be registered automatically on the next request.

$wgWBRepoSettings

Settings that configure the wiki as a Wikibase repository (the authoritative source of entity data).
entitySources
array
The full $entitySources array (see above). Assigned after WikibaseLexeme detection so lexeme entries are included if active.
localEntitySourceName
string
'local' — tells the repo which entry in entitySources is the canonical local source.
entityNamespaces
array
Maps 'item', 'property' (and optionally 'lexeme') to their namespace IDs. Values come from $wmgWikibaseRepoItemNamespaceID and $wmgWikibaseRepoPropertyNamespaceID.
allowEntityImport
bool
Controlled by $wmgAllowEntityImport. Determines whether entities can be imported from another Wikibase instance via Special:Import.
enableEntitySearchUI
bool
Controlled by $wmgEnableEntitySearchUI. Toggles the entity search UI in the repo.
federatedPropertiesEnabled
bool
Controlled by $wmgFederatedPropertiesEnabled. When true, the repo reads property definitions from a federated source (e.g. Wikidata) rather than local properties.
formatterUrlProperty
string|null
Controlled by $wmgFormatterUrlProperty (or null if empty). The property ID used to provide formatted display URLs for external identifiers.
canonicalUriProperty
string|null
Controlled by $wmgCanonicalUriProperty (or null if empty). The property ID used to declare canonical URIs for entities.
dataRightsUrl
string
Hardcoded to 'https://creativecommons.org/publicdomain/zero/1.0/'. All entity data on WikiOasis Wikibase repos is licensed under CC0 1.0 Universal (public domain dedication).
siteGlobalID
string
Set to $wgDBname — each wiki identifies itself to the Wikibase federation by its database name.
['wikioasis'] — the sitelink group used for WikiOasis wikis. Sites in this group can be linked to items.
[] — no special sitelink groups are configured.

$wgWBClientSettings

Settings that configure the wiki as a Wikibase client (a consumer of entity data from a repo).
entitySources
array
The same $entitySources array as used by the repo, pointing at the local wiki’s database.
itemAndPropertySourceName
string
'local' — tells the client which entity source to use for items and properties.
repoUrl
string
Set from $wmgWikibaseRepoUrl. The URL of the Wikibase repo this client is connected to.
repoDatabase
string
Set from $wmgWikibaseRepoDatabase. The DB name of the repo for direct database connections.
changesDatabase
string
Also set from $wmgWikibaseRepoDatabase. The database used to read recent entity changes for propagation to client wikis.
siteGlobalID
string
Set to $wgDBname, matching the repo’s siteGlobalID for the same wiki.
repoScriptPath
string
'' — the repo’s script path is at the domain root.
repoArticlePath
string
'/wiki/$1' — standard MediaWiki article path for entity page links.
siteGroup
string
'wikioasis' — the sitelink group this client belongs to, matching siteLinkGroups on the repo.
repoNamespaces
array
{
  "wikibase-item": "Item",
  "wikibase-property": "Property"
}
Maps Wikibase entity type keys to their namespace names on the repo.
['wikioasis'] — sitelink groups the client participates in.
purgeCacheBatchSize
int
100 — the number of pages to purge in a single batch when entity data changes.
recentChangesBatchSize
int
100 — the number of recent changes to process per batch when propagating entity changes to client wikis.
tmpUnconnectedPagePagePropMigrationStage
int
Set to MIGRATION_NEW — opts into the new unconnected page property storage format.

MobileFrontend Integration

$wgMFUseWikibase = true;
Setting $wgMFUseWikibase to true enables MobileFrontend’s Wikibase integration, which allows the mobile skin to display entity descriptions beneath article titles and use other Wikibase-sourced metadata when rendering pages on mobile.

Complete Configuration Flow

1

Extension check

GlobalSettings.php checks $wi->isExtensionActive('Wikibase') before including Wikibase.php. If Wikibase is not active for the wiki, this file is never loaded.
2

Entity source construction

$entitySources is built from the per-wiki ManageWiki settings ($wmgWikibaseRepoItemNamespaceID, $wmgWikibaseRepoPropertyNamespaceID, $wmgWikibaseRepoDatabase, $wmgWikibaseRepoUrl).
3

WikibaseLexeme detection

If WikibaseLexeme is active, namespace 146 is injected into $entitySources and $wgWBRepoSettings['entityNamespaces'].
4

Repo settings applied

$wgWBRepoSettings is populated with entity sources, namespace IDs, feature flags, data rights, and site identity.
5

Client settings applied

$wgWBClientSettings is populated with the same entity sources plus client-specific connection settings and batch sizes.
6

MobileFrontend flag set

$wgMFUseWikibase = true enables the MobileFrontend–Wikibase integration.
7

Cleanup

The local $entitySources variable is unset() to avoid polluting the global namespace.
Quality constraints property and item IDs (used for Wikibase constraint checking) are mapped in LocalSettings.php following Wikidata-compatible patterns. These are separate from the settings in Wikibase.php and are applied after the main Wikibase configuration.
To enable Wikibase on a wiki: (1) navigate to Special:ManageWiki/extensions and enable Wikibase; (2) go to Special:ManageWiki/settings and configure wmgWikibaseRepoItemNamespaceID, wmgWikibaseRepoPropertyNamespaceID, wmgWikibaseRepoDatabase, and wmgWikibaseRepoUrl for your setup. The local entity source is automatically constructed from these values on the next request.

Build docs developers (and LLMs) love