r97771 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97770‎ | r97771 | r97772 >
Date:00:06, 22 September 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
Hacked in $wgResourceBasePath variable for setting the default base path for resources.
Modified paths:
  • /branches/wmf/1.18wmf1/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderFileModule.php
@@ -148,9 +148,13 @@
149149 public function __construct( $options = array(), $localBasePath = null,
150150 $remoteBasePath = null )
151151 {
152 - global $IP, $wgScriptPath;
 152+ global $IP, $wgScriptPath, $wgResourceBasePath;
153153 $this->localBasePath = $localBasePath === null ? $IP : $localBasePath;
154 - $this->remoteBasePath = $remoteBasePath === null ? $wgScriptPath : $remoteBasePath;
 154+ if ( $wgResourceBasePath !== null ) {
 155+ $this->remoteBasePath = $wgResourceBasePath;
 156+ } else {
 157+ $this->remoteBasePath = $remoteBasePath === null ? $wgScriptPath : $remoteBasePath;
 158+ }
155159
156160 if ( isset( $options['remoteExtPath'] ) ) {
157161 global $wgExtensionAssetsPath;
Index: branches/wmf/1.18wmf1/includes/DefaultSettings.php
@@ -2453,6 +2453,12 @@
24542454 $wgResourceModules = array();
24552455
24562456 /**
 2457+ * Default 'remoteBasePath' value for resource loader modules.
 2458+ * If not set, then $wgScriptPath will be used as a fallback.
 2459+ */
 2460+$wgResourceBasePath = null;
 2461+
 2462+/**
24572463 * Maximum time in seconds to cache resources served by the resource loader
24582464 */
24592465 $wgResourceLoaderMaxage = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r97775Fixed wtf from r97771aaron00:38, 22 September 2011
r98760Merge r97771, r97775reedy13:37, 3 October 2011

Comments

#Comment by Tim Starling (talk | contribs)   00:30, 22 September 2011

I think $wgResourceBasePath should override $wgScriptPath, not remoteBasePath from the constructor. Presumably if an extension is setting remoteBasePath then what it sets it to should be configurable. Was there a reason for doing it like that?

Status & tagging log