http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97771
Revision: 97771
Author: aaron
Date: 2011-09-22 00:06:56 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
Hacked in $wgResourceBasePath variable for setting the default base path for
resources.
Modified Paths:
--------------
branches/wmf/1.18wmf1/includes/DefaultSettings.php
branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php
Modified: branches/wmf/1.18wmf1/includes/DefaultSettings.php
===================================================================
--- branches/wmf/1.18wmf1/includes/DefaultSettings.php 2011-09-21 23:18:15 UTC
(rev 97770)
+++ branches/wmf/1.18wmf1/includes/DefaultSettings.php 2011-09-22 00:06:56 UTC
(rev 97771)
@@ -2453,6 +2453,12 @@
$wgResourceModules = 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
*/
$wgResourceLoaderMaxage = array(
Modified:
branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php
===================================================================
--- branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php
2011-09-21 23:18:15 UTC (rev 97770)
+++ branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php
2011-09-22 00:06:56 UTC (rev 97771)
@@ -148,9 +148,13 @@
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 ( $wgResourceBasePath !== null ) {
+ $this->remoteBasePath = $wgResourceBasePath;
+ } else {
+ $this->remoteBasePath = $remoteBasePath === null ?
$wgScriptPath : $remoteBasePath;
+ }
if ( isset( $options['remoteExtPath'] ) ) {
global $wgExtensionAssetsPath;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs