⚓ T146616 Expose wiki ID in Lua Site library
Page Menu
Phabricator
Create Task
Maniphest
T146616
Expose wiki ID in Lua Site library
Closed, Resolved
Public
Actions
Edit Task
Edit Related Tasks...
Create Subtask
Edit Parent Tasks
Edit Subtasks
Merge Duplicates In
Close As Duplicate
Edit Related Objects...
Edit Commits
Edit Mocks
Mute Notifications
Protect as security issue
Assigned To
Redmin
Authored By
PerfektesChaos
Sep 26 2016, 8:01 AM
2016-09-26 08:01:19 (UTC+0)
Tags
Scribunto
(Backlog)
good first task
MW-1.46-notes (1.46.0-wmf.19; 2026-03-10)
User-notice-archive
(Backlog)
Referenced Files
None
Subscribers
Aklapper
Jackmcbarn
PerfektesChaos
STei-WMF
TerraCodes
Description
Expose wiki ID in mw.site library in Scribunto (instead of
$wgDBname
which is unsuitable when multiple wikis are stored on the same database; see discussion below and on the linked patch).
Original request
Create component for
$wgDBname
in
mw.site
Rationale:
When providing Lua modules for multiple wiki projects, local adaptions should be supported easily. Based on a short DB name the appropriate adjustments need to be accessed.
Currently there is available only a
mw.site.server
field.
This requires
if mw.site.server == "//de.wikipedia.org" or
mw.site.server == "//de.wikipedia.beta.wmflabs.org" then
site = "dewiki"
end
Details
Related Changes in Gerrit:
Subject
Repo
Branch
Lines +/-
Add mw.site.wikiId
mediawiki/extensions/Scribunto
master
+7
-0
Customize query in gerrit
Related Objects
Search...
Task Graph
Mentions
Status
Subtype
Assigned
Task
Open
Feature
None
T50176
Requested Scribunto/Lua built-in methods/functions (tracking)
Resolved
Redmin
T146616
Expose wiki ID in Lua Site library
Mentioned In
T420606: Add mw.site.wikiId to CodeMirror
T194023: Expose siteGlobalID in Lua
Event Timeline
PerfektesChaos
created this task.
Sep 26 2016, 8:01 AM
2016-09-26 08:01:19 (UTC+0)
Restricted Application
added a subscriber:
Aklapper
View Herald Transcript
Sep 26 2016, 8:01 AM
2016-09-26 08:01:19 (UTC+0)
PerfektesChaos
updated the task description.
(Show Details)
Sep 26 2016, 9:58 AM
2016-09-26 09:58:27 (UTC+0)
Anomie
added a project:
good first task
Sep 26 2016, 2:34 PM
2016-09-26 14:34:28 (UTC+0)
Anomie
subscribed.
Comment Actions
Local adaptations would probably be better done with a configuration data-module rather than code branching on the identity of the current site.
IMO it would be more sensible to provide
mw.site.wikiid
as
wfWikiId()
, rather than
$wgDBname
Restricted Application
added a subscriber:
TerraCodes
View Herald Transcript
Sep 26 2016, 2:34 PM
2016-09-26 14:34:28 (UTC+0)
Jackmcbarn
subscribed.
Sep 26 2016, 6:07 PM
2016-09-26 18:07:00 (UTC+0)
Comment Actions
I tend to agree with Anomie on this. I'm not sure this should be done.
PerfektesChaos
added a comment.
Sep 27 2016, 9:38 AM
2016-09-27 09:38:54 (UTC+0)
Comment Actions
Some
wikiid
or
wikiId
rather than traditional
dbname
would be fine with me.
The concept of local config modules is understood, as you might see
here
or
here
or
here
However, local configs require local people and even sysops to maintain a software configuration theirselves. I know many wiks that are not able to do this with local software experts, asking e.g. German Wikipedia for support. They would have to adapt each new feature locally.
A config scenario might be shared on a larger number of wikis, with exceptions for only a few ones, like e.g. Commons. Then global maintenance of a few standard groups of different profiles provides a more robust behaviour and will share all updates, and adaptions are performed by some global experts. Might be combined and overruled by local config modules anyway.
Jackmcbarn
added a comment.
Sep 27 2016, 7:00 PM
2016-09-27 19:00:58 (UTC+0)
Comment Actions
In
T146616#2670000
@PerfektesChaos
wrote:
The concept of local config modules is understood, as you might see
here
or
here
or
here
However, local configs require local people and even sysops to maintain a software configuration theirselves. I know many wiks that are not able to do this with local software experts, asking e.g. German Wikipedia for support. They would have to adapt each new feature locally.
A config scenario might be shared on a larger number of wikis, with exceptions for only a few ones, like e.g. Commons. Then global maintenance of a few standard groups of different profiles provides a more robust behaviour and will share all updates, and adaptions are performed by some global experts. Might be combined and overruled by local config modules anyway.
This seems like a non sequitur. None of this is improved by being able to automatically switch by wiki ID, since the different configurations for different wiki IDs would have to be written anyway (just in a different place). And centralized modules are also totally orthogonal to this.
hoo
mentioned this in
T194023: Expose siteGlobalID in Lua
May 7 2018, 10:56 AM
2018-05-07 10:56:37 (UTC+0)
Aklapper
removed a subscriber:
Anomie
Oct 16 2020, 5:01 PM
2020-10-16 17:01:38 (UTC+0)
Pppery
added a parent task:
T50176: Requested Scribunto/Lua built-in methods/functions (tracking)
Nov 4 2023, 2:17 AM
2023-11-04 02:17:36 (UTC+0)
Redmin
claimed this task.
Feb 20 2026, 6:58 PM
2026-02-20 18:58:10 (UTC+0)
gerritbot
added a comment.
Feb 21 2026, 5:51 AM
2026-02-21 05:51:36 (UTC+0)
Comment Actions
Change #1241054 had a related patch set uploaded (by R4356thwiki; author: R4356thwiki):
[mediawiki/extensions/Scribunto@master] Add mw.site.dbName
gerritbot
added a project:
Patch-For-Review
Feb 21 2026, 5:51 AM
2026-02-21 05:51:37 (UTC+0)
Redmin
added a project:
User-notice
Feb 21 2026, 6:28 AM
2026-02-21 06:28:10 (UTC+0)
Comment Actions
This would probably be worth announcing via Tech News.
Redmin
moved this task from
To Triage
to
Not ready to announce
on the
User-notice
board.
Feb 21 2026, 6:28 AM
2026-02-21 06:28:24 (UTC+0)
Redmin
renamed this task from
Expose DBNAME in Lua Site library
to
Expose wiki ID in Lua Site library
Mar 9 2026, 4:32 PM
2026-03-09 16:32:07 (UTC+0)
Redmin
updated the task description.
(Show Details)
Redmin
updated the task description.
(Show Details)
gerritbot
added a comment.
Mar 9 2026, 4:44 PM
2026-03-09 16:44:40 (UTC+0)
Comment Actions
Change #1241054
merged
by jenkins-bot:
[mediawiki/extensions/Scribunto@master] Add mw.site.wikiId
Redmin
closed this task as
Resolved
Mar 9 2026, 4:45 PM
2026-03-09 16:45:35 (UTC+0)
Redmin
moved this task from
Not ready to announce
to
Announce in next Tech/News
on the
User-notice
board.
ReleaseTaggerBot
added a project:
MW-1.46-notes (1.46.0-wmf.19; 2026-03-10)
Mar 9 2026, 5:00 PM
2026-03-09 17:00:37 (UTC+0)
Maintenance_bot
removed a project:
Patch-For-Review
Mar 9 2026, 5:32 PM
2026-03-09 17:32:06 (UTC+0)
STei-WMF
subscribed.
Mar 12 2026, 4:16 PM
2026-03-12 16:16:43 (UTC+0)
Comment Actions
@Redmin
how should this be worded for Tech News?
Redmin
added a comment.
Mar 12 2026, 8:03 PM
2026-03-12 20:03:34 (UTC+0)
Comment Actions
The [[mw:Extension:Scribunto|Scribunto]] extension provides different pieces of information about the wiki where the module is being used via the [[mw:Extension:Scribunto/Lua reference manual#mw.site|mw.site]] library. Starting lasting week, the library also provides a [[mw:Extension:Scribunto/Lua reference manual#mw.site.wikiId|way]] of accessing the [[mw:Manual:Wiki ID|wiki ID]] that can be used to facilitate cross-wiki module maintenance.
Perhaps something like this will do. The change rode this week’s train.
STei-WMF
moved this task from
Announce in next Tech/News
to
In current Tech/News draft
on the
User-notice
board.
Mar 13 2026, 11:18 AM
2026-03-13 11:18:52 (UTC+0)
STei-WMF
moved this task from
In current Tech/News draft
to
Already announced/Archive
on the
User-notice
board.
Mar 16 2026, 9:11 PM
2026-03-16 21:11:47 (UTC+0)
Redmin
mentioned this in
T420606: Add mw.site.wikiId to CodeMirror
Mar 19 2026, 3:57 PM
2026-03-19 15:57:36 (UTC+0)
Maintenance_bot
edited projects, added
User-notice-archive
; removed
User-notice
Sun, Mar 29, 4:30 PM
2026-03-29 16:30:50 (UTC+0)
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct.
Wikimedia Foundation
Code of Conduct
Disclaimer
CC-BY-SA
GPL
Credits