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.
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 Type | ManageWiki Variable | Applies To |
|---|---|---|
| Item | $wmgWikibaseRepoItemNamespaceID | Repo entity source, $wgWBRepoSettings['entityNamespaces'] |
| Property | $wmgWikibaseRepoPropertyNamespaceID | Repo entity source, $wgWBRepoSettings['entityNamespaces'] |
| Lexeme | Hardcoded 146 | Added only when WikibaseLexeme is active |
WikibaseLexeme Support
When theWikibaseLexeme extension is active for a wiki, Wikibase.php extends the entity source and repo settings to include lexemes:
$wgWBRepoSettings['entityNamespaces'] (so the repo stores and serves them).
$wgWBRepoSettings
Settings that configure the wiki as a Wikibase repository (the authoritative source of entity data).The full
$entitySources array (see above). Assigned after WikibaseLexeme detection so lexeme entries are included if active.'local' — tells the repo which entry in entitySources is the canonical local source.Maps
'item', 'property' (and optionally 'lexeme') to their namespace IDs. Values come from $wmgWikibaseRepoItemNamespaceID and $wmgWikibaseRepoPropertyNamespaceID.Controlled by
$wmgAllowEntityImport. Determines whether entities can be imported from another Wikibase instance via Special:Import.Controlled by
$wmgEnableEntitySearchUI. Toggles the entity search UI in the repo.Controlled by
$wmgFederatedPropertiesEnabled. When true, the repo reads property definitions from a federated source (e.g. Wikidata) rather than local properties.Controlled by
$wmgFormatterUrlProperty (or null if empty). The property ID used to provide formatted display URLs for external identifiers.Controlled by
$wmgCanonicalUriProperty (or null if empty). The property ID used to declare canonical URIs for entities.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).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).The same
$entitySources array as used by the repo, pointing at the local wiki’s database.'local' — tells the client which entity source to use for items and properties.Set from
$wmgWikibaseRepoUrl. The URL of the Wikibase repo this client is connected to.Set from
$wmgWikibaseRepoDatabase. The DB name of the repo for direct database connections.Also set from
$wmgWikibaseRepoDatabase. The database used to read recent entity changes for propagation to client wikis.Set to
$wgDBname, matching the repo’s siteGlobalID for the same wiki.'' — the repo’s script path is at the domain root.'/wiki/$1' — standard MediaWiki article path for entity page links.'wikioasis' — the sitelink group this client belongs to, matching siteLinkGroups on the repo.['wikioasis'] — sitelink groups the client participates in.100 — the number of pages to purge in a single batch when entity data changes.100 — the number of recent changes to process per batch when propagating entity changes to client wikis.Set to
MIGRATION_NEW — opts into the new unconnected page property storage format.MobileFrontend Integration
$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
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.Entity source construction
$entitySources is built from the per-wiki ManageWiki settings ($wmgWikibaseRepoItemNamespaceID, $wmgWikibaseRepoPropertyNamespaceID, $wmgWikibaseRepoDatabase, $wmgWikibaseRepoUrl).WikibaseLexeme detection
If WikibaseLexeme is active, namespace 146 is injected into
$entitySources and $wgWBRepoSettings['entityNamespaces'].Repo settings applied
$wgWBRepoSettings is populated with entity sources, namespace IDs, feature flags, data rights, and site identity.Client settings applied
$wgWBClientSettings is populated with the same entity sources plus client-specific connection settings and batch sizes.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.