From 0aab120e96cc8296da559086bf14a91b9744ae3d Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 6 Apr 2015 15:31:31 -0700 Subject: [PATCH] resourceloader: Require $wgResourceModuleSkinStyles paths to be in the base definition No skin in gerrit uses the feature of per-module local or remote paths, and not supporting it will make implementing extension/skin.json support easier. Change-Id: I22863ef29426dbacd65439a12aeae56d4d757951 --- RELEASE-NOTES-1.25 | 2 ++ includes/DefaultSettings.php | 15 --------------- includes/resourceloader/ResourceLoader.php | 5 +---- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 1ec8b930b4..5bb58939c5 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -424,6 +424,8 @@ changes to languages because of Bugzilla reports. retrievedfrom, thisisdeleted, viewsourcelink, lastmodifiedat, laggedslavemode, protect-summary-cascade * All BloomCache related code has been removed. This was largely experimental. +* $wgResourceModuleSkinStyles no longer supports per-module local or remote paths. They + can only be set for the entire skin. == Compatibility == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fe67adf550..c8197f2893 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3338,8 +3338,6 @@ $wgResourceModules = array(); * * As with $wgResourceModules, paths default to being relative to the MediaWiki root. * You should always provide a localBasePath and remoteBasePath (or remoteExtPath/remoteSkinPath). - * Either for all skin styles at once (first example below) or for each module separately (second - * example). * * @par Example: * @code @@ -3349,19 +3347,6 @@ $wgResourceModules = array(); * 'remoteSkinPath' => 'Foo', * 'localBasePath' => __DIR__, * ); - * - * $wgResourceModuleSkinStyles['foo'] = array( - * 'bar' => array( - * 'bar.css', - * 'remoteSkinPath' => 'Foo', - * 'localBasePath' => __DIR__, - * ), - * 'quux' => array( - * 'quux.css', - * 'remoteSkinPath' => 'Foo', - * 'localBasePath' => __DIR__, - * ), - * ); * @endcode */ $wgResourceModuleSkinStyles = array(); diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 976275bb23..3d5cc51590 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -346,12 +346,9 @@ class ResourceLoader { } // Add new file paths, remapping them to refer to our directories and not use settings - // from the module we're modifying. These can come from the base definition or be defined - // for each module. + // from the module we're modifying, which come from the base definition. list( $localBasePath, $remoteBasePath ) = ResourceLoaderFileModule::extractBasePaths( $skinStyles ); - list( $localBasePath, $remoteBasePath ) = - ResourceLoaderFileModule::extractBasePaths( $paths, $localBasePath, $remoteBasePath ); foreach ( $paths as $path ) { $styleFiles[] = new ResourceLoaderFilePath( $path, $localBasePath, $remoteBasePath ); -- 2.20.1