22use Wikimedia\ObjectFactory;
66 if ( is_callable(
$class ) ) {
82 return is_object( $obj ) && !$obj instanceof
StubObject;
93 public static function unstub( &$obj ) {
95 $obj = $obj->_unstub(
'unstub', 3 );
112 return call_user_func_array( [
$GLOBALS[$this->global], $name ],
$args );
123 return ObjectFactory::getObjectFromSpec(
$params + [
124 'args' => $this->params,
125 'closure_expansion' =>
false,
153 public function _unstub( $name =
'_unstub', $level = 2 ) {
154 static $recursionLevel = 0;
160 if ( get_class(
$GLOBALS[$this->global] ) != $this->
class ) {
162 if ( ++$recursionLevel > 2 ) {
163 throw new MWException(
"Unstub loop detected on call of "
164 .
"\${$this->global}->$name from $caller\n" );
166 wfDebug(
"Unstubbing \${$this->global} on call of "
167 .
"\${$this->global}::$name from $caller\n" );
181 parent::__construct(
'wgLang' );
198 $this->
_unstub(
'findVariantLink', 3 );
199 $wgLang->findVariantLink(
$link, $nt, $ignoreOtherCond );
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
static getMain()
Get the RequestContext object associated with the main request.
Class to implement stub globals, which are globals that delay loading the their associated module cod...
_unstub( $name='_unstub', $level=2)
This function creates a new object of the real class and replace it in the global variable.
_call( $name, $args)
Function called if any function exists with that name in this object.
static unstub(&$obj)
Unstubs an object, if it is a stub object.
_newObject()
Create a new object to replace this stub object.
__construct( $global=null, $class=null, $params=[])
__call( $name, $args)
Function called by PHP if no function with that name exists in this object.
static isRealObject( $obj)
Returns a bool value whenever $obj is a stub object.
Stub object for the user language.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
Call Language::findVariantLink after unstubbing $wgLang.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
usually copyright or history_copyright This message must be in HTML not wikitext & $link