MediaWiki  1.34.0
StubUserLang.php
Go to the documentation of this file.
1 <?php
24 class StubUserLang extends StubObject {
25 
26  public function __construct() {
27  parent::__construct( 'wgLang' );
28  }
29 
42  public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
43  global $wgLang;
44  $this->_unstub( 'findVariantLink', 3 );
45  $wgLang->findVariantLink( $link, $nt, $ignoreOtherCond );
46  }
47 
51  public function _newObject() {
52  return RequestContext::getMain()->getLanguage();
53  }
54 }
StubUserLang\__construct
__construct()
Definition: StubUserLang.php:26
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:45
$wgLang
$wgLang
Definition: Setup.php:881
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:431
StubUserLang\_newObject
_newObject()
Definition: StubUserLang.php:51
StubObject\_unstub
_unstub( $name='_unstub', $level=2)
This function creates a new object of the real class and replace it in the global variable.
Definition: StubObject.php:153
StubUserLang\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
Call Language::findVariantLink after unstubbing $wgLang.
Definition: StubUserLang.php:42