summaryrefslogtreecommitdiff
path: root/includes/installer/WebInstallerOutput.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /includes/installer/WebInstallerOutput.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'includes/installer/WebInstallerOutput.php')
-rw-r--r--includes/installer/WebInstallerOutput.php37
1 files changed, 21 insertions, 16 deletions
diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php
index 3094d557..0ccdb11a 100644
--- a/includes/installer/WebInstallerOutput.php
+++ b/includes/installer/WebInstallerOutput.php
@@ -133,26 +133,24 @@ class WebInstallerOutput {
'mediawiki.skinning.interface',
);
- if ( file_exists( "$wgStyleDirectory/Vector/Vector.php" ) ) {
+ $resourceLoader = new ResourceLoader();
+
+ if ( file_exists( "$wgStyleDirectory/Vector/skin.json" ) ) {
// Force loading Vector skin if available as a fallback skin
// for whatever ResourceLoader wants to have as the default.
-
- // Include instead of require, as this will work without it, it will just look bad.
- // We need the 'global' statement for $wgResourceModules because the Vector skin adds the
- // definitions for its RL modules there that we use implicitly below.
-
- // @codingStandardsIgnoreStart
- global $wgResourceModules; // This is NOT UNUSED!
- // @codingStandardsIgnoreEnd
-
- include_once "$wgStyleDirectory/Vector/Vector.php";
+ $registry = new ExtensionRegistry();
+ $data = $registry->readFromQueue( array(
+ "$wgStyleDirectory/Vector/skin.json" => 1,
+ ) );
+ if ( isset( $data['globals']['wgResourceModules'] ) ) {
+ $resourceLoader->register( $data['globals']['wgResourceModules'] );
+ }
$moduleNames[] = 'skins.vector.styles';
}
$moduleNames[] = 'mediawiki.legacy.config';
- $resourceLoader = new ResourceLoader();
$rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( array(
'debug' => 'true',
'lang' => $this->getLanguageCode(),
@@ -163,6 +161,10 @@ class WebInstallerOutput {
foreach ( $moduleNames as $moduleName ) {
/** @var ResourceLoaderFileModule $module */
$module = $resourceLoader->getModule( $moduleName );
+ if ( !$module ) {
+ // T98043: Don't fatal, but it won't look as pretty.
+ continue;
+ }
// Based on: ResourceLoaderFileModule::getStyles (without the DB query)
$styles = array_merge( $styles, ResourceLoader::makeCombinedStyles(
@@ -227,7 +229,7 @@ class WebInstallerOutput {
public function getHeadAttribs() {
return array(
'dir' => $this->getDir(),
- 'lang' => $this->getLanguageCode(),
+ 'lang' => wfBCP47( $this->getLanguageCode() ),
);
}
@@ -296,11 +298,14 @@ class WebInstallerOutput {
href="https://www.mediawiki.org/"
title="Main Page"></a>
</div>
- <div class="portal"><div class="body">
<?php
- echo $this->parent->parse( wfMessage( 'config-sidebar' )->plain(), true );
+ $message = wfMessage( 'config-sidebar' )->plain();
+ foreach ( explode( '----', $message ) as $section ) {
+ echo '<div class="portal"><div class="body">';
+ echo $this->parent->parse( $section, true );
+ echo '</div></div>';
+ }
?>
- </div></div>
</div>
<?php