Go to the documentation of this file.
29 use Wikimedia\Assert\Assert;
43 'NamespacesToBeSearchedDefault'
69 $this->serviceOptions = $options;
71 $this->hookRunner =
new HookRunner( $hookContainer );
78 if ( $this->defaultOptions !==
null ) {
82 $this->defaultOptions = $this->serviceOptions->get(
'DefaultUserOptions' );
85 $this->defaultOptions[
'language'] = $this->contentLang->getCode();
87 if ( $langCode === $this->contentLang->getCode() ) {
88 $this->defaultOptions[
'variant'] = $langCode;
90 $this->defaultOptions[
"variant-$langCode"] = $langCode;
97 foreach ( $this->serviceOptions->get(
'NamespacesToBeSearchedDefault' ) as $nsnum => $val ) {
98 $this->defaultOptions[
'searchNs' . $nsnum] = (bool)$val;
100 $this->defaultOptions[
'skin'] =
Skin::normalizeKey( $this->serviceOptions->get(
'DefaultSkin' ) );
102 $this->hookRunner->onUserGetDefaultOptions( $this->defaultOptions );
112 return $defOpts[$opt] ??
null;
121 $defaultOverride =
null,
122 bool $ignoreHidden =
false,
123 int $queryFlags = self::READ_NORMAL
135 int $queryFlags = self::READ_NORMAL
138 if ( $flags & self::EXCLUDE_DEFAULTS ) {
153 Assert::precondition( !$user->
isRegistered(),
"$fname called on a registered user " );
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.
static array $languagesWithVariants
languages supporting variants
The main skin class which provides methods and properties for all other skins.
Base class for multi-variant language conversion.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...