29use 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();
86 foreach ( LanguageConverter::$languagesWithVariants as $langCode ) {
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 );
113 $defaultOverride =
null,
114 bool $ignoreHidden =
false,
115 int $queryFlags = self::READ_NORMAL
117 $this->verifyUsable( $user, __METHOD__ );
118 return $this->getDefaultOption( $oname ) ?? $defaultOverride;
127 int $queryFlags = self::READ_NORMAL
129 $this->verifyUsable( $user, __METHOD__ );
130 if ( $flags & self::EXCLUDE_DEFAULTS ) {
133 return $this->getDefaultOptions();
145 Assert::precondition( !$user->
isRegistered(),
"$fname called on a registered user " );
if(ini_get('mbstring.func_overload')) if(!defined('MW_ENTRY_POINT'))
Pre-config setup: Before loading LocalSettings.php.
Base class for multi-variant language conversion.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
The main skin class which provides methods and properties for all other skins.
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.