Merge r97771, r97775
authorSam Reed <reedy@users.mediawiki.org>
Mon, 3 Oct 2011 13:37:47 +0000 (13:37 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 3 Oct 2011 13:37:47 +0000 (13:37 +0000)
includes/DefaultSettings.php
includes/resourceloader/ResourceLoaderFileModule.php

index 99a3abb..35ae738 100644 (file)
@@ -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
  */
index 6b30eb1..0b006bf 100644 (file)
@@ -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;