Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\NamespaceChecker Class Reference

Checks if a namespace in Wikibase Client shall have wikibase links, etc., based on settings. More...

Public Member Functions

 __construct (array $excludedNamespaces, array $enabledNamespaces=[], NamespaceInfo $namespaceInfo=null)
 
 isWikibaseEnabled ( $namespace)
 Per the settings, does the namespace have wikibase enabled? note: excludeNamespaces, if set, overrides namespace (inclusion) settings.
 
 getEnabledNamespaces ()
 
 getExcludedNamespaces ()
 
 getWikibaseNamespaces ()
 Get the namespaces Wikibase is effectively enabled in.
 

Private Member Functions

 isExcluded ( $namespace)
 Check if the namespace is excluded by settings for having wikibase links, etc.
 
 isEnabled ( $namespace)
 Check if namespace is enabled for Wikibase, based on the 'namespaces' setting.
 

Private Attributes

 $excludedNamespaces
 
 $enabledNamespaces
 
 $namespaceInfo
 

Detailed Description

Checks if a namespace in Wikibase Client shall have wikibase links, etc., based on settings.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\NamespaceChecker::__construct ( array $excludedNamespaces,
array $enabledNamespaces = [],
NamespaceInfo $namespaceInfo = null )
Parameters
int[]$excludedNamespaces
int[]$enabledNamespacesif empty, setting not in use and all namespaces enabled
NamespaceInfo | null$namespaceInfofalls back to default instance

Member Function Documentation

◆ getEnabledNamespaces()

Wikibase\Client\NamespaceChecker::getEnabledNamespaces ( )
Returns
int[]

◆ getExcludedNamespaces()

Wikibase\Client\NamespaceChecker::getExcludedNamespaces ( )
Returns
int[]

◆ getWikibaseNamespaces()

Wikibase\Client\NamespaceChecker::getWikibaseNamespaces ( )

Get the namespaces Wikibase is effectively enabled in.

Returns
int[]

◆ isEnabled()

Wikibase\Client\NamespaceChecker::isEnabled ( $namespace)
private

Check if namespace is enabled for Wikibase, based on the 'namespaces' setting.

Note: If no list of enabled namespaces is configured, all namespaces are considered to be enabled for Wikibase.

Parameters
int$namespace
Returns
bool

◆ isExcluded()

Wikibase\Client\NamespaceChecker::isExcluded ( $namespace)
private

Check if the namespace is excluded by settings for having wikibase links, etc.

based on the 'excludeNamespaces' setting.

Parameters
int$namespace
Returns
bool

◆ isWikibaseEnabled()

Wikibase\Client\NamespaceChecker::isWikibaseEnabled ( $namespace)

Per the settings, does the namespace have wikibase enabled? note: excludeNamespaces, if set, overrides namespace (inclusion) settings.

Parameters
int$namespace
Exceptions
InvalidArgumentException
Returns
bool

Member Data Documentation

◆ $enabledNamespaces

Wikibase\Client\NamespaceChecker::$enabledNamespaces
private

◆ $excludedNamespaces

Wikibase\Client\NamespaceChecker::$excludedNamespaces
private

◆ $namespaceInfo

Wikibase\Client\NamespaceChecker::$namespaceInfo
private

The documentation for this class was generated from the following file: