MediaWiki REL1_33
SearchEngineConfig Class Reference

Configuration handling class for SearchEngine. More...

Collaboration diagram for SearchEngineConfig:

Public Member Functions

 __construct (Config $config, Language $lang)
 
 defaultNamespaces ()
 An array of namespaces indexes to be searched by default.
 
 getConfig ()
 Retrieve original config.
 
 getSearchType ()
 Return the search engine configured in $wgSearchType, etc.
 
 getSearchTypes ()
 Return the search engines we support.
 
 namespacesAsText ( $namespaces)
 Get a list of namespace names useful for showing in tooltips and preferences.
 
 searchableNamespaces ()
 Make a list of searchable namespaces and their canonical names.
 
 userNamespaces ( $user)
 Extract default namespaces to search from the given user's settings, returning a list of index numbers.
 

Private Attributes

Config $config
 Config object from which the settings will be derived.
 
Language $language
 Current language.
 

Detailed Description

Configuration handling class for SearchEngine.

Provides added service over plain configuration.

Since
1.27

Definition at line 9 of file SearchEngineConfig.php.

Constructor & Destructor Documentation

◆ __construct()

SearchEngineConfig::__construct ( Config $config,
Language $lang )

Definition at line 23 of file SearchEngineConfig.php.

References $lang, and language().

Member Function Documentation

◆ defaultNamespaces()

SearchEngineConfig::defaultNamespaces ( )

An array of namespaces indexes to be searched by default.

Returns
int[] Namespace IDs

Definition at line 75 of file SearchEngineConfig.php.

References and().

◆ getConfig()

SearchEngineConfig::getConfig ( )

Retrieve original config.

Returns
Config

Definition at line 32 of file SearchEngineConfig.php.

◆ getSearchType()

SearchEngineConfig::getSearchType ( )

Return the search engine configured in $wgSearchType, etc.

Returns
string|null

Definition at line 97 of file SearchEngineConfig.php.

◆ getSearchTypes()

SearchEngineConfig::getSearchTypes ( )

Return the search engines we support.

If only $wgSearchType is set, it'll be an array of just that one item.

Returns
array

Definition at line 85 of file SearchEngineConfig.php.

References and().

◆ namespacesAsText()

SearchEngineConfig::namespacesAsText ( $namespaces)

Get a list of namespace names useful for showing in tooltips and preferences.

Parameters
int[]$namespaces
Returns
string[] List of names

Definition at line 108 of file SearchEngineConfig.php.

References $namespaces, and(), language(), and wfMessage().

◆ searchableNamespaces()

SearchEngineConfig::searchableNamespaces ( )

Make a list of searchable namespaces and their canonical names.

Returns
array Namespace ID => name

Definition at line 40 of file SearchEngineConfig.php.

References $name, and(), language(), and NS_MAIN.

Referenced by userNamespaces().

◆ userNamespaces()

SearchEngineConfig::userNamespaces ( $user)

Extract default namespaces to search from the given user's settings, returning a list of index numbers.

Parameters
user$user
Returns
int[]

Definition at line 59 of file SearchEngineConfig.php.

References and(), and searchableNamespaces().

Member Data Documentation

◆ $config

Config SearchEngineConfig::$config
private

Config object from which the settings will be derived.

Definition at line 15 of file SearchEngineConfig.php.

◆ $language

Language SearchEngineConfig::$language
private

Current language.

Definition at line 21 of file SearchEngineConfig.php.


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