X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstallerOutput.php;h=211bad1e0b5ed4016cd8497a23b56fcc05f56daf;hb=f2c242e2e8d86d6d12ae9c160b88c43558306d8f;hp=44ca7d3001ddf894da6a636dc10a110c4470a81a;hpb=69bd2e54d698f32120940f80f3493479297ecf74;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index 44ca7d3001..211bad1e0b 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,12 +161,17 @@ 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( $module->readStyleFiles( $module->getStyleFiles( $rlContext ), - $module->getFlip( $rlContext ) + $module->getFlip( $rlContext ), + $rlContext ) ) ); }