r83512 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83511‎ | r83512 | r83513 >
Date:06:38, 8 March 2011
Author:tstarling
Status:ok
Tags:
Comment:
Set $wgInternalServer to false by default, and fall back to $wgServer in the referring code. This avoids having squid updates break when $wgServer is set in configuration but $wgInternalServer is neglected. For immediate deployment, tested locally.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SquidUpdate.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -990,8 +990,9 @@
991991 * @return String the URL
992992 */
993993 public function getInternalURL( $query = '', $variant = false ) {
994 - global $wgInternalServer;
995 - $url = $wgInternalServer . $this->getLocalURL( $query, $variant );
 994+ global $wgInternalServer, $wgServer;
 995+ $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
 996+ $url = $server . $this->getLocalURL( $query, $variant );
996997 wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
997998 return $url;
998999 }
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1768,7 +1768,7 @@
17691769 * $wgInternalServer = 'http://yourinternal.tld:8000';
17701770 * </code>
17711771 */
1772 -$wgInternalServer = $wgServer;
 1772+$wgInternalServer = false;
17731773
17741774 /**
17751775 * Cache timeout for the squid, will be sent as s-maxage (without ESI) or
Index: trunk/phase3/includes/SquidUpdate.php
@@ -193,9 +193,10 @@
194194 * @return string
195195 */
196196 static function expand( $url ) {
197 - global $wgInternalServer;
198 - if( $url != '' && $url{0} == '/' ) {
199 - return $wgInternalServer . $url;
 197+ global $wgInternalServer, $wgServer;
 198+ $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
 199+ if( $url !== '' && $url[0] == '/' ) {
 200+ return $server . $url;
200201 }
201202 return $url;
202203 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r83513MFT r83512: fix squid purges from runJobs.php, were using http://localhosttstarling06:40, 8 March 2011
r92996Merge r87111, which is a merge of r70966, r71049...reedy18:31, 24 July 2011

Status & tagging log