From f639abf12e51c0abc524b7cca7207241d06b3089 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 3 Oct 2011 13:37:47 +0000 Subject: [PATCH] Merge r97771, r97775 --- includes/DefaultSettings.php | 7 +++++++ includes/resourceloader/ResourceLoaderFileModule.php | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 99a3abb8af..35ae738373 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1381,6 +1381,7 @@ $wgExternalServers = array(); * * $wgDefaultExternalStore = array( 'DB://cluster1', 'DB://cluster2' ); * + * @var array */ $wgDefaultExternalStore = false; @@ -2487,6 +2488,12 @@ $wgResourceModules = array(); */ $wgResourceLoaderSources = array(); +/* + * Default 'remoteBasePath' value for resource loader modules. + * If not set, then $wgScriptPath will be used as a fallback. + */ +$wgResourceBasePath = null; + /** * Maximum time in seconds to cache resources served by the resource loader */ diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 6b30eb192d..0b006bf8d4 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -148,9 +148,13 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { public function __construct( $options = array(), $localBasePath = null, $remoteBasePath = null ) { - global $IP, $wgScriptPath; + global $IP, $wgScriptPath, $wgResourceBasePath; $this->localBasePath = $localBasePath === null ? $IP : $localBasePath; - $this->remoteBasePath = $remoteBasePath === null ? $wgScriptPath : $remoteBasePath; + if ( $remoteBasePath !== null ) { + $this->remoteBasePath = $remoteBasePath; + } else { + $this->remoteBasePath = $wgResourceBasePath === null ? $wgScriptPath : $wgResourceBasePath; + } if ( isset( $options['remoteExtPath'] ) ) { global $wgExtensionAssetsPath; -- 2.20.1