Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc.
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 1 Sep 2015 16:13:02 +0000 (18:13 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 1 Sep 2015 16:18:03 +0000 (18:18 +0200)
This make re-configuring these much easier by only needing to update
one variable instead of four.

Also remove redundant hardcoding of wgStylePath and wgResourceBasePath
in the generated LocalSettings.php file during installation. This way
changing wgScriptPath will naturally result in the other variables
updating too. We already do this for many other variables (such as
wgLoadScript, wgScript, wgExtensionAssetsPath, etc.).

Change-Id: Ide74355b4054c78214c17f3b2d6fa2f5270e0ab9

includes/DefaultSettings.php
includes/Setup.php
includes/installer/LocalSettingsGenerator.php

index c0aad5d..f0450a9 100644 (file)
@@ -211,7 +211,7 @@ $wgLoadScript = false;
 
 /**
  * The URL path of the skins directory.
- * Defaults to "{$wgScriptPath}/skins".
+ * Defaults to "{$wgResourceBasePath}/skins".
  * @since 1.3
  */
 $wgStylePath = false;
@@ -226,7 +226,7 @@ $wgLocalStylePath = false;
 
 /**
  * The URL path of the extensions directory.
- * Defaults to "{$wgScriptPath}/extensions".
+ * Defaults to "{$wgResourceBasePath}/extensions".
  * @since 1.16
  */
 $wgExtensionAssetsPath = false;
@@ -3473,8 +3473,8 @@ $wgResourceModuleSkinStyles = array();
 $wgResourceLoaderSources = array();
 
 /**
- * Default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
- * If not set, then $wgScriptPath will be used as a fallback.
+ * The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
+ * Defaults to $wgScriptPath.
  */
 $wgResourceBasePath = null;
 
index 86df4b8..6abef44 100644 (file)
@@ -68,17 +68,18 @@ if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
        $wgActionPaths['view'] = $wgArticlePath;
 }
 
+if ( $wgResourceBasePath === null ) {
+       $wgResourceBasePath = $wgScriptPath;
+}
 if ( $wgStylePath === false ) {
-       $wgStylePath = "$wgScriptPath/skins";
+       $wgStylePath = "$wgResourceBasePath/skins";
 }
 if ( $wgLocalStylePath === false ) {
+       // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
        $wgLocalStylePath = "$wgScriptPath/skins";
 }
 if ( $wgExtensionAssetsPath === false ) {
-       $wgExtensionAssetsPath = "$wgScriptPath/extensions";
-}
-if ( $wgResourceBasePath === null ) {
-       $wgResourceBasePath = $wgScriptPath;
+       $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
 }
 
 if ( $wgLogo === false ) {
index 7b1cfdc..09b5929 100644 (file)
@@ -332,9 +332,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 ## https://www.mediawiki.org/wiki/Manual:Short_URL
 \$wgScriptPath = \"{$this->values['wgScriptPath']}\";
 ${serverSetting}
-## The relative URL path to the skins directory
-\$wgStylePath = \"\$wgScriptPath/skins\";
-\$wgResourceBasePath = \$wgScriptPath;
 
 ## The relative URL path to the logo.  Make sure you change this from the default,
 ## or else you'll overwrite your logo when you upgrade!