MediaWiki REL1_35
|
A service class to control default user options. More...
Public Member Functions | ||||||||||||||||
__construct (ServiceOptions $options, Language $contentLang, HookContainer $hookContainer) | ||||||||||||||||
getDefaultOption (string $opt) | ||||||||||||||||
Get a given default option value.
| ||||||||||||||||
getDefaultOptions () | ||||||||||||||||
Combine the language default options with any site-specific options and add the default language variants.
| ||||||||||||||||
getOption (UserIdentity $user, string $oname, $defaultOverride=null, bool $ignoreHidden=false, int $queryFlags=self::READ_NORMAL) | ||||||||||||||||
Get the user's current setting for a given option.
| ||||||||||||||||
getOptions (UserIdentity $user, int $flags=0, int $queryFlags=self::READ_NORMAL) | ||||||||||||||||
Get all user's options.
| ||||||||||||||||
Public Member Functions inherited from MediaWiki\User\UserOptionsLookup | ||||||||||||||||
getBoolOption (UserIdentity $user, string $oname, int $queryFlags=self::READ_NORMAL) | ||||||||||||||||
Get the user's current setting for a given option, as a boolean value. | ||||||||||||||||
getIntOption (UserIdentity $user, string $oname, int $defaultOverride=0, int $queryFlags=self::READ_NORMAL) | ||||||||||||||||
Get the user's current setting for a given option, as an integer value. | ||||||||||||||||
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Public Attributes inherited from MediaWiki\User\UserOptionsLookup | |
const | EXCLUDE_DEFAULTS = 1 |
Exclude user options that are set to their default value. | |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) | |
const | READ_NONE = -1 |
Private Member Functions | |
verifyUsable (UserIdentity $user, string $fname) | |
Checks if the DefaultOptionsLookup is usable as an instance of UserOptionsLookup. | |
Private Attributes | |
Language | $contentLang |
array null | $defaultOptions = null |
Cached default options. | |
HookRunner | $hookRunner |
ServiceOptions | $serviceOptions |
A service class to control default user options.
Definition at line 35 of file DefaultOptionsLookup.php.
MediaWiki\User\DefaultOptionsLookup::__construct | ( | ServiceOptions | $options, |
Language | $contentLang, | ||
HookContainer | $hookContainer | ||
) |
ServiceOptions | $options | |
Language | $contentLang | |
HookContainer | $hookContainer |
Definition at line 60 of file DefaultOptionsLookup.php.
References MediaWiki\User\DefaultOptionsLookup\$contentLang, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\User\DefaultOptionsLookup::getDefaultOption | ( | string | $opt | ) |
Get a given default option value.
string | $opt | Name of option to retrieve |
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 107 of file DefaultOptionsLookup.php.
MediaWiki\User\DefaultOptionsLookup::getDefaultOptions | ( | ) |
Combine the language default options with any site-specific options and add the default language variants.
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 74 of file DefaultOptionsLookup.php.
References MediaWiki\User\DefaultOptionsLookup\$defaultOptions.
MediaWiki\User\DefaultOptionsLookup::getOption | ( | UserIdentity | $user, |
string | $oname, | ||
$defaultOverride = null , |
|||
bool | $ignoreHidden = false , |
||
int | $queryFlags = self::READ_NORMAL |
||
) |
Get the user's current setting for a given option.
UserIdentity | $user | The user to get the option for |
string | $oname | The option to check |
mixed | null | $defaultOverride | A default value returned if the option does not exist |
bool | $ignoreHidden | Whether to ignore the effects of $wgHiddenPrefs |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 115 of file DefaultOptionsLookup.php.
MediaWiki\User\DefaultOptionsLookup::getOptions | ( | UserIdentity | $user, |
int | $flags = 0 , |
||
int | $queryFlags = self::READ_NORMAL |
||
) |
Get all user's options.
UserIdentity | $user | The user to get the option for |
int | $flags | Bitwise combination of: UserOptionsManager::EXCLUDE_DEFAULTS Exclude user options that are set to the default value. |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 129 of file DefaultOptionsLookup.php.
|
private |
Checks if the DefaultOptionsLookup is usable as an instance of UserOptionsLookup.
It only makes sense in an installer context when UserOptionsManager cannot be yet instantiated as the database is not available. Thus, this can only be called for an anon user, calling under different circumstances indicates a bug.
UserIdentity | $user | |
string | $fname |
Definition at line 149 of file DefaultOptionsLookup.php.
References MediaWiki\User\UserIdentity\isRegistered().
|
private |
Definition at line 47 of file DefaultOptionsLookup.php.
Referenced by MediaWiki\User\DefaultOptionsLookup\__construct().
|
private |
Cached default options.
Definition at line 50 of file DefaultOptionsLookup.php.
Referenced by MediaWiki\User\DefaultOptionsLookup\getDefaultOptions().
|
private |
Definition at line 53 of file DefaultOptionsLookup.php.
|
private |
Definition at line 44 of file DefaultOptionsLookup.php.
const MediaWiki\User\DefaultOptionsLookup::CONSTRUCTOR_OPTIONS |
Definition at line 37 of file DefaultOptionsLookup.php.