MediaWiki REL1_36
StubUserLang.php
Go to the documentation of this file.
1<?php
22
26class 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}
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
$wgLang
Definition Setup.php:813
MediaWikiServices is the service locator for the application scope of MediaWiki.
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.
Stub object for the user language.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
Call Language::findVariantLink after unstubbing $wgLang.