41 protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
52 'patrolToken' => $user->getEditToken(
'patrol' ),
53 'watchToken' => $user->getEditToken(
'watch' ),
54 'csrfToken' => $user->getEditToken(),
56 $script =
'mw.user.tokens.set(' . $context->
encodeJson( $tokens ) .
');' .
"\n";
63 $options = $userOptionsLookup->
getOptions( $user, UserOptionsLookup::EXCLUDE_DEFAULTS );
66 $this->
getHookRunner()->onResourceLoaderExcludeUserOptions( $keysToExclude, $context );
67 foreach ( $keysToExclude as $excludedKey ) {
68 unset( $options[ $excludedKey ] );
73 $script .=
'mw.user.options.set(' . $context->
encodeJson( $options ) .
');' .
"\n";
90 return self::GROUP_PRIVATE;
Context object that contains information about the state of a specific ResourceLoader web request.
encodeJson( $data)
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode.
getUserObj()
Get the possibly-cached User object for the specified username.