|
MediaWiki master
|
Stub object for the global user ($wgUser) that makes it possible to change the relevant underlying object while still ensuring that deprecation warnings will be emitted upon method calls. More...
Inherits MediaWiki\StubObject\StubObject.

Public Member Functions | |
| __construct (User $realUser) | |
| __destruct () | |
| _newObject () | |
| _unstub ( $name='_unstub', $level=2) | |
| This function creates a new object of the real class and replace it in the global variable. | |
Public Member Functions inherited from MediaWiki\StubObject\StubObject | |
| __call ( $name, $args) | |
| Function called by PHP if no function with that name exists in this object. | |
| __construct ( $global=null, $class=null, $params=[]) | |
| __get ( $name) | |
| Function called by PHP if no property with that name exists in this object. | |
| __set ( $name, $value) | |
| Function called by PHP if no property with that name exists in this object. | |
| _call ( $name, $args) | |
| Function called if any function exists with that name in this object. | |
| _get ( $name) | |
| Wrapper for __get(), similar to _call() above. | |
| _set ( $name, $value) | |
| Wrapper for __set(), similar to _call() above. | |
Static Public Member Functions | |
| static | getRealUser ( $globalUser) |
| Get the relevant "real" user object based on either a User object or a MediaWiki\StubObject\StubGlobalUser wrapper. | |
| static | setUser ( $user) |
| Reset the stub global user to a different "real" user object, while ensuring that any method calls on that object will still trigger deprecation notices. | |
Static Public Member Functions inherited from MediaWiki\StubObject\StubObject | |
| static | isRealObject ( $obj) |
| Returns a bool value whenever $obj is a stub object. | |
| static | unstub (&$obj) |
| Unstubs an object, if it is a stub object. | |
Public Attributes | |
| User | $realUser |
Static Public Attributes | |
| static bool | $destructorDeprecationDisarmed = false |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\StubObject\StubObject | |
| null string | $class |
| null callable | $factory |
| null string | $global |
| array | $params |
Stub object for the global user ($wgUser) that makes it possible to change the relevant underlying object while still ensuring that deprecation warnings will be emitted upon method calls.
Definition at line 25 of file StubGlobalUser.php.
| MediaWiki\StubObject\StubGlobalUser::__construct | ( | User | $realUser | ) |
Definition at line 33 of file StubGlobalUser.php.
References MediaWiki\StubObject\StubGlobalUser\$realUser.
| MediaWiki\StubObject\StubGlobalUser::__destruct | ( | ) |
Definition at line 135 of file StubGlobalUser.php.
References wfDeprecatedMsg().
| MediaWiki\StubObject\StubGlobalUser::_newObject | ( | ) |
Reimplemented from MediaWiki\StubObject\StubObject.
Definition at line 42 of file StubGlobalUser.php.
References MediaWiki\StubObject\StubGlobalUser\$realUser, and wfDeprecated().
| MediaWiki\StubObject\StubGlobalUser::_unstub | ( | $name = '_unstub', | |
| $level = 2 ) |
This function creates a new object of the real class and replace it in the global variable.
This is public, for the convenience of external callers wishing to access properties, e.g. eval.php
Overriding MediaWiki\StubObject\StubObject::_unstub because for some reason that thinks there is an unstub loop when trying to use the magic __set() logic, but there isn't any loop because _newObject() returns a specific instance of User rather than calling any methods that could then try to use $wgUser. The main difference between this and the parent method is that we don't try to check for recursion loops.
| string | $name | Name of the method called in this object. |
| int | $level | Level to go in the stack trace to get the function who called this function. |
Reimplemented from MediaWiki\StubObject\StubObject.
Definition at line 123 of file StubGlobalUser.php.
References wfDebug(), and wfGetCaller().
|
static |
Get the relevant "real" user object based on either a User object or a MediaWiki\StubObject\StubGlobalUser wrapper.
Bypasses deprecation notices from converting a MediaWiki\StubObject\StubGlobalUser to an actual user, and does not change $wgUser.
| StubGlobalUser | User | $globalUser |
Definition at line 92 of file StubGlobalUser.php.
Referenced by MediaWiki\StubObject\StubGlobalUser\setUser().
|
static |
Reset the stub global user to a different "real" user object, while ensuring that any method calls on that object will still trigger deprecation notices.
| StubGlobalUser | User | $user |
Definition at line 71 of file StubGlobalUser.php.
References MediaWiki\StubObject\StubGlobalUser\$realUser, $wgUser, and MediaWiki\StubObject\StubGlobalUser\getRealUser().
Referenced by MediaWiki\Api\ApiMain\__construct().
|
static |
Definition at line 28 of file StubGlobalUser.php.
| User MediaWiki\StubObject\StubGlobalUser::$realUser |
Definition at line 31 of file StubGlobalUser.php.
Referenced by MediaWiki\StubObject\StubGlobalUser\__construct(), MediaWiki\StubObject\StubGlobalUser\_newObject(), and MediaWiki\StubObject\StubGlobalUser\setUser().