Manual:MWNamespace.php
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed from MediaWiki core in version <tvar name=ver>1.39 (phab:rMWea1c106ea9a3)</tvar> (after being deprecated in <tvar name=4>1.34</tvar>).</translate> <translate> Please see <tvar name=page>NamespaceInfo.php</tvar> for an alternative way to use this feature.</translate> |
MediaWiki file: MWNamespace.php | |
---|---|
Location: | includes/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | MWNamespace |
MWNamespace.php contains the MWNamespace class, a utility class with only static functions for dealing with namespaces that encodes all the "magic" behaviors of them based on index.
Methods
MWNamespace::getCanonicalNamespaces( $rebuild )
- Returns array of all defined namespaces with their canonical (English) names.MWNamespace::getCanonicalName( $index )
- Returns the canonical (English) name for a given indexMWNamespace::getValidNamespaces()
- Returns an array of the namespaces (by integer id) that exist on the wiki. Used primarily by the api in help documentation. This function callsgetCanonicalNamespaces()
without using the rebuild option and it then excludes the negative number namespaces, e.g. -1 (special page).
External links
- MWNamespace - MediaWiki 1.34
- NamespaceInfo.php - MediaWiki 1.34