[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Delayed loading of global objects. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
File Size: | 187 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 2 times |
Includes or requires: | 0 files |
StubObject:: (7 methods):
__construct()
isRealObject()
unstub()
_call()
_newObject()
__call()
_unstub()
StubUserLang:: (3 methods):
__construct()
__call()
_newObject()
Class: StubObject - X-Ref
Class to implement stub globals, which are globals that delay loading the__construct( $global = null, $class = null, $params = array() X-Ref |
Constructor. param: string $global Name of the global variable. param: string $class Name of the class of the real object. param: array $params Parameters to pass to constructor of the real object. |
isRealObject( $obj ) X-Ref |
Returns a bool value whenever $obj is a stub object. Can be used to break a infinite loop when unstubbing an object. param: object $obj Object to check. return: bool True if $obj is not an instance of StubObject class. |
unstub( &$obj ) X-Ref |
Unstubs an object, if it is a stub object. Can be used to break a infinite loop when unstubbing an object or to avoid reference parameter breakage. param: object $obj Object to check. return: void |
_call( $name, $args ) X-Ref |
Function called if any function exists with that name in this object. It is used to unstub the object. Only used internally, PHP will call self::__call() function and that function will call this function. This function will also call the function with the same name in the real object. param: string $name Name of the function called param: array $args Arguments return: mixed |
_newObject() X-Ref |
Create a new object to replace this stub object. return: object |
__call( $name, $args ) X-Ref |
Function called by PHP if no function with that name exists in this object. param: string $name Name of the function called param: array $args Arguments return: mixed |
_unstub( $name = '_unstub', $level = 2 ) X-Ref |
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 param: string $name Name of the method called in this object. param: int $level Level to go in the stack trace to get the function return: object The unstubbed version of itself |
Class: StubUserLang - X-Ref
Stub object for the user language. It depends of the user preferences and__construct() X-Ref |
No description |
__call( $name, $args ) X-Ref |
No description |
_newObject() X-Ref |
return: Language |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |