MediaWiki
master
StubUserLang.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\MediaWikiServices
;
22
26
class
StubUserLang
extends
StubObject
{
27
28
public
function
__construct
() {
29
parent::__construct(
'wgLang'
);
30
}
31
45
public
function
findVariantLink
( &$link, &$nt, $ignoreOtherCond =
false
) {
46
global
$wgLang
;
47
wfDeprecated
( __METHOD__,
'1.35'
);
48
$this->
_unstub
(
'findVariantLink'
, 3 );
49
MediaWikiServices::getInstance()
50
->getLanguageConverterFactory()
51
->getLanguageConverter(
$wgLang
)
52
->findVariantLink( $link, $nt, $ignoreOtherCond );
53
}
54
58
public
function
_newObject
() {
59
return
RequestContext::getMain
()->getLanguage();
60
}
61
}
StubUserLang\__construct
__construct()
Definition:
StubUserLang.php:28
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition:
MediaWikiServices.php:166
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition:
StubObject.php:51
$wgLang
$wgLang
Definition:
Setup.php:777
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition:
GlobalFunctions.php:1033
StubUserLang
Stub object for the user language.
Definition:
StubUserLang.php:26
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition:
RequestContext.php:454
StubUserLang\_newObject
_newObject()
Definition:
StubUserLang.php:58
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:164
StubUserLang\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
Call Language::findVariantLink after unstubbing $wgLang.
Definition:
StubUserLang.php:45
includes
StubUserLang.php
Generated on Sat Jan 16 2021 03:10:43 for MediaWiki by
1.8.19