*
* @ingroup Deployment
* @since 1.17
+ * @private
*/
class WebInstallerOutput {
/**
* @param string $text
- * @deprecated since 1.32; use addWikiTextInterface instead
+ * @deprecated since 1.32; use addWikiTextAsInterface instead
*/
public function addWikiText( $text ) {
wfDeprecated( __METHOD__, '1.32' );
- $this->addWikiTextInterface( $text );
+ $this->addWikiTextAsInterface( $text );
}
/**
* @param string $text
+ * @since 1.32
*/
- public function addWikiTextInterface( $text ) {
+ public function addWikiTextAsInterface( $text ) {
$this->addHTML( $this->parent->parse( $text ) );
}
$rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( [
'debug' => 'true',
- 'lang' => $this->getLanguageCode(),
+ 'lang' => $this->getLanguage()->getCode(),
'only' => 'styles',
] ) );
* @return string
*/
private function getCssUrl() {
- return Html::linkedStyle( $_SERVER['PHP_SELF'] . '?css=1' );
+ return Html::linkedStyle( $this->parent->getUrl( [ 'css' => 1 ] ) );
}
public function useShortHeader( $use = true ) {
}
/**
- * @return string
- */
- public function getDir() {
- global $wgLang;
-
- return is_object( $wgLang ) ? $wgLang->getDir() : 'ltr';
- }
-
- /**
- * @return string
+ * @since 1.33
+ * @return Language
*/
- public function getLanguageCode() {
+ private function getLanguage() {
global $wgLang;
- return is_object( $wgLang ) ? $wgLang->getCode() : 'en';
+ return is_object( $wgLang ) ? $wgLang : Language::factory( 'en' );
}
/**
*/
public function getHeadAttribs() {
return [
- 'dir' => $this->getDir(),
- 'lang' => LanguageCode::bcp47( $this->getLanguageCode() ),
+ 'dir' => $this->getLanguage()->getDir(),
+ 'lang' => $this->getLanguage()->getHtmlCode(),
];
}
<?php echo Html::linkedScript( 'config.js' ) . "\n"; ?>
</head>
-<?php echo Html::openElement( 'body', [ 'class' => $this->getDir() ] ) . "\n"; ?>
+<?php echo Html::openElement( 'body', [ 'class' => $this->getLanguage()->getDir() ] ) . "\n"; ?>
<div id="mw-page-base"></div>
<div id="mw-head-base"></div>
<div id="content" class="mw-body">