MediaWiki master
|
Configuration handling class for SearchEngine. More...
Public Member Functions | |
__construct (ServiceOptions $options, Language $lang, HookContainer $hookContainer, array $mappings, UserOptionsLookup $userOptionsLookup) | |
defaultNamespaces () | |
An array of namespaces indexes to be searched by default. | |
getConfig () | |
Retrieve original config. | |
getSearchMappings () | |
Returns the mappings between canonical search name and underlying PHP class. | |
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 localized names. | |
userNamespaces ( $user) | |
Extract default namespaces to search from the given user's settings, returning a list of index numbers. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Configuration handling class for SearchEngine.
Provides added service over plain configuration.
Definition at line 17 of file SearchEngineConfig.php.
SearchEngineConfig::__construct | ( | ServiceOptions | $options, |
Language | $lang, | ||
HookContainer | $hookContainer, | ||
array | $mappings, | ||
UserOptionsLookup | $userOptionsLookup ) |
ServiceOptions | $options | |
Language | $lang | |
HookContainer | $hookContainer | |
array | $mappings | |
UserOptionsLookup | $userOptionsLookup |
Definition at line 66 of file SearchEngineConfig.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
SearchEngineConfig::defaultNamespaces | ( | ) |
An array of namespaces indexes to be searched by default.
Definition at line 131 of file SearchEngineConfig.php.
SearchEngineConfig::getConfig | ( | ) |
Retrieve original config.
Definition at line 86 of file SearchEngineConfig.php.
References wfDeprecated().
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 178 of file SearchEngineConfig.php.
SearchEngineConfig::getSearchType | ( | ) |
Return the search engine configured in $wgSearchType, etc.
Definition at line 154 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 142 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 189 of file SearchEngineConfig.php.
References wfMessage().
SearchEngineConfig::searchableNamespaces | ( | ) |
Make a list of searchable namespaces and their localized names.
Definition at line 96 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.
UserIdentity | $user |
Definition at line 115 of file SearchEngineConfig.php.
References searchableNamespaces().
const SearchEngineConfig::CONSTRUCTOR_OPTIONS |
Definition at line 20 of file SearchEngineConfig.php.