installer: Replace Vector dependency in WebInstallerOutput with fallback skin

Rather than hardcode a Vector module, the installer should use the fallback
skin.

This leaves it mostly unstyled, which will be restored in a separate change
that adds a minimal stylesheet for the web installer (see Ibdb0a7208).

Bug: T248133
Change-Id: I5c7f16ec9efda35b94355b6c81ec78d9bdfb574b
This commit is contained in:
jdlrobson 2020-03-19 14:32:05 -07:00 committed by Krinkle
parent 92df2fea88
commit 00e8bde685

View file

@ -131,31 +131,13 @@ class WebInstallerOutput {
* @return string
*/
public function getCSS() {
global $wgStyleDirectory;
$moduleNames = [
// Based on Vector::setupSkinUserCss
'mediawiki.skinning.interface',
'mediawiki.legacy.config'
];
$resourceLoader = MediaWikiServices::getInstance()->getResourceLoader();
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.
$registry = new ExtensionRegistry();
$data = $registry->readFromQueue( [
"$wgStyleDirectory/Vector/skin.json" => 1,
] );
if ( isset( $data['attributes']['ResourceModules'] ) ) {
$resourceLoader->register( $data['attributes']['ResourceModules'] );
}
$moduleNames[] = 'skins.vector.styles';
}
$moduleNames[] = 'mediawiki.legacy.config';
$rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( [
'debug' => 'true',
'lang' => $this->getLanguage()->getCode(),
@ -260,6 +242,7 @@ class WebInstallerOutput {
return;
}
?>
<?php echo Html::htmlHeader( $this->getHeadAttribs() ); ?>