X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstallerOutput.php;h=914a69e930af5daf1ad01055aad290074e6424a9;hb=360f741d390bedc0e63c49b93d4d845e91863355;hp=950aaf7827556f8335e5c0406c09f22cc960bb46;hpb=6fc769a2a8412015dff2cbd6bde94cd9d2c079c5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index 950aaf7827..914a69e930 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -21,6 +21,8 @@ * @ingroup Deployment */ +use MediaWiki\MediaWikiServices; + /** * Output class modelled on OutputPage. * @@ -31,6 +33,7 @@ * * @ingroup Deployment * @since 1.17 + * @private */ class WebInstallerOutput { @@ -146,7 +149,7 @@ class WebInstallerOutput { 'mediawiki.skinning.interface', ]; - $resourceLoader = new ResourceLoader(); + $resourceLoader = MediaWikiServices::getInstance()->getResourceLoader(); if ( file_exists( "$wgStyleDirectory/Vector/skin.json" ) ) { // Force loading Vector skin if available as a fallback skin @@ -166,7 +169,7 @@ class WebInstallerOutput { $rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( [ 'debug' => 'true', - 'lang' => $this->getLanguageCode(), + 'lang' => $this->getLanguage()->getCode(), 'only' => 'styles', ] ) ); @@ -220,21 +223,13 @@ class WebInstallerOutput { } /** - * @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' ); } /** @@ -242,8 +237,8 @@ class WebInstallerOutput { */ public function getHeadAttribs() { return [ - 'dir' => $this->getDir(), - 'lang' => LanguageCode::bcp47( $this->getLanguageCode() ), + 'dir' => $this->getLanguage()->getDir(), + 'lang' => $this->getLanguage()->getHtmlCode(), ]; } @@ -287,7 +282,7 @@ class WebInstallerOutput { - $this->getDir() ] ) . "\n"; ?> + $this->getLanguage()->getDir() ] ) . "\n"; ?>
@@ -309,9 +304,7 @@ class WebInstallerOutput {
plain(); @@ -330,13 +323,14 @@ class WebInstallerOutput { public function outputShortHeader() { ?> getHeadAttribs() ); ?> + - + <?php $this->outputTitle(); ?> getCssUrl() . "\n"; ?> - getJQuery(); ?> - + getJQuery() . "\n"; ?> +