MediaWiki
master
|
Configuration handling class for SearchEngine. More...
Public Member Functions | |
__construct (Config $config, Language $lang, HookContainer $hookContainer, array $mappings) | |
defaultNamespaces () | |
An array of namespaces indexes to be searched by default. More... | |
getConfig () | |
Retrieve original config. More... | |
getSearchMappings () | |
Returns the mappings between canonical search name and underlying PHP class. More... | |
getSearchType () | |
Return the search engine configured in $wgSearchType, etc. More... | |
getSearchTypes () | |
Return the search engines we support. More... | |
namespacesAsText ( $namespaces) | |
Get a list of namespace names useful for showing in tooltips and preferences. More... | |
searchableNamespaces () | |
Make a list of searchable namespaces and their localized names. More... | |
userNamespaces ( $user) | |
Extract default namespaces to search from the given user's settings, returning a list of index numbers. More... | |
Private Attributes | |
Config | $config |
Config object from which the settings will be derived. More... | |
array | $engineMappings |
Search Engine Mappings. More... | |
HookRunner | $hookRunner |
Language | $language |
Current language. More... | |
Configuration handling class for SearchEngine.
Provides added service over plain configuration.
Definition at line 13 of file SearchEngineConfig.php.
SearchEngineConfig::__construct | ( | Config | $config, |
Language | $lang, | ||
HookContainer | $hookContainer, | ||
array | $mappings | ||
) |
SearchEngineConfig::defaultNamespaces | ( | ) |
An array of namespaces indexes to be searched by default.
Definition at line 105 of file SearchEngineConfig.php.
SearchEngineConfig::getConfig | ( | ) |
Retrieve original config.
Definition at line 61 of file SearchEngineConfig.php.
References $config.
SearchEngineConfig::getSearchMappings | ( | ) |
Returns the mappings between canonical search name and underlying PHP class.
Key is the canonical name (used in $wgSearchType and $wgSearchTypeAlternatives). Value is a specification for ObjectFactory.
For example to be able to use 'foobarsearch' in $wgSearchType and $wgSearchTypeAlternatives but the PHP class for 'foobarsearch' is 'MediaWiki\Extension\FoobarSearch\FoobarSearch' set:
Definition at line 152 of file SearchEngineConfig.php.
References $engineMappings.
SearchEngineConfig::getSearchType | ( | ) |
Return the search engine configured in $wgSearchType, etc.
Definition at line 128 of file SearchEngineConfig.php.
SearchEngineConfig::getSearchTypes | ( | ) |
Return the search engines we support.
If only $wgSearchType is set, it'll be an array of just that one item.
Definition at line 116 of file SearchEngineConfig.php.
SearchEngineConfig::namespacesAsText | ( | $namespaces | ) |
Get a list of namespace names useful for showing in tooltips and preferences.
int[] | $namespaces |
Definition at line 163 of file SearchEngineConfig.php.
References wfMessage().
SearchEngineConfig::searchableNamespaces | ( | ) |
Make a list of searchable namespaces and their localized names.
Definition at line 70 of file SearchEngineConfig.php.
References NS_MAIN.
Referenced by userNamespaces().
SearchEngineConfig::userNamespaces | ( | $user | ) |
Extract default namespaces to search from the given user's settings, returning a list of index numbers.
user | $user |
Definition at line 89 of file SearchEngineConfig.php.
References searchableNamespaces().
|
private |
Config object from which the settings will be derived.
Definition at line 19 of file SearchEngineConfig.php.
Referenced by __construct(), and getConfig().
|
private |
Search Engine Mappings.
Key is the canonical name (used in $wgSearchType and $wgSearchTypeAlternatives). Value is a specification for ObjectFactory.
Definition at line 35 of file SearchEngineConfig.php.
Referenced by getSearchMappings().
|
private |
Definition at line 40 of file SearchEngineConfig.php.
|
private |
Current language.
Definition at line 25 of file SearchEngineConfig.php.