Page MenuHomePhabricator

Add wgContentNamespaces to mw.config
Closed, ResolvedPublic

Description

Currently it seems the list of content namespaces of the wiki is not available for scripts.

Would it be possible to provide access to it through mw.config.get('wgContentNamespaces')?


Version: 1.21.x
Severity: enhancement

Details

Reference
bz41881

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:49 AM
bzimport set Reference to bz41881.
bzimport added a subscriber: Unknown Object (MLST).

@Roan, @Trevor

There are a lot of parameters currently in mw config that are really inter-related and would suit having their own module, and therewith avoid bloating the startup module.

Like we (almost) did for mw.user, though it currently still fetches its info through wgUserName...

Basically data provider modules (generated like LanguageDataModule) for classes. In the case of wgContentNamespaces it would be provided by the data provider module for mw.Title and accessible through some static method of mw.Title.

I would like to put a stop on putting more variables in mw.config until we figure out a way to deal with this. Reason being that whatever we put in it, we have to support for a long while.

As for the current needs: I believe this information is available in the API.

It seems that I need this too in order to be able to know about all the content namespaces (outside the main namespace - like the "portal" namespace on Wikipedia) and mirror them all for full offline dumps.

Comment 3 was about http://sourceforge.net/p/kiwix/feature-requests/818 , which has now been fixed by using the API instead (action=query&meta=siteinfo&siprop=namespaces).