37 private $engineMappings;
47 private $userOptionsLookup;
63 $this->config = $config;
64 $this->language =
$lang;
65 $this->engineMappings = $mappings;
66 $this->hookRunner =
new HookRunner( $hookContainer );
67 $this->userOptionsLookup = $userOptionsLookup;
85 foreach ( $this->language->getNamespaces() as $ns => $name ) {
91 $this->hookRunner->onSearchableNamespaces( $arr );
105 if ( $this->userOptionsLookup->getOption( $user,
'searchNs' . $ns ) ) {
119 return array_keys( $this->config->get( MainConfigNames::NamespacesToBeSearchedDefault ),
130 $alternatives = $this->config->get( MainConfigNames::SearchTypeAlternatives ) ?: [];
131 array_unshift( $alternatives, $this->config->get( MainConfigNames::SearchType ) );
133 return $alternatives;
142 return $this->config->get( MainConfigNames::SearchType );
166 return $this->engineMappings;
177 $formatted = array_map( [ $this->language,
'getFormattedNsText' ], $namespaces );
178 foreach ( $formatted as $key => $ns ) {
179 if ( empty( $ns ) ) {
180 $formatted[$key] =
wfMessage(
'blanknamespace' )->text();
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Base class for language-specific code.
A class containing constants representing the names of configuration variables.
Configuration handling class for SearchEngine.
getConfig()
Retrieve original config.
getSearchTypes()
Return the search engines we support.
getSearchType()
Return the search engine configured in $wgSearchType, etc.
getSearchMappings()
Returns the mappings between canonical search name and underlying PHP class.
searchableNamespaces()
Make a list of searchable namespaces and their localized names.
namespacesAsText( $namespaces)
Get a list of namespace names useful for showing in tooltips and preferences.
userNamespaces( $user)
Extract default namespaces to search from the given user's settings, returning a list of index number...
defaultNamespaces()
An array of namespaces indexes to be searched by default.
__construct(Config $config, Language $lang, HookContainer $hookContainer, array $mappings, UserOptionsLookup $userOptionsLookup)
Interface for configuration instances.
if(!isset( $args[0])) $lang