Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/209786

Change subject: Use $wgServer to construct static-asset URLs
......................................................................

Use $wgServer to construct static-asset URLs

* Revert I452b5014f ("revert state of wgResourceBasePath to before
  bits-related changes").
* Use $wgServer to construct URLs to static assets. $wgServer is derived from
  the project and language, rather than anything tied to the current request
  context.

Change-Id: I6236f5e2c5026867f797b1b2813c98554fd59e22
---
M wmf-config/CommonSettings.php
1 file changed, 7 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/86/209786/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index cf684e6..d9870e6 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -196,22 +196,10 @@
 unset( $wgStylePath );
 unset( $wgStyleSheetPath );
 
-$wmgAssetsHost = $_SERVER['SERVER_NAME'];
-$wgLoadScript = "//{$wmgAssetsHost}/w/load.php";
-$wgExtensionAssetsPath = 
"//{$wmgAssetsHost}/static/$wmfVersionNumber/extensions";
-$wgStyleSheetPath = "//{$wmgAssetsHost}/static/$wmfVersionNumber/skins";
-
-// New URL scheme
-if ( $wgDBname == 'testwiki' ) {
-       // Make testing skin/JS changes easier
-       $wgResourceBasePath = 
"//{$wmfHostnames['test']}/w/static-$wmfVersionNumber"; // This means resources 
will be requested from /w/static-VERSION/resources
-} elseif ( $wgDBname == 'testwikidatawiki' && $wmfRealm === 'production' ) {
-       $wgResourceBasePath = "//test.wikidata.org/w/static-$wmfVersionNumber"; 
// This means resources will be requested from /w/static-VERSION/resources
-} elseif ( $wgDBname == 'labswiki' ) {
-       $wgResourceBasePath = 
"//wikitech.wikimedia.org/w/static-$wmfVersionNumber"; // This means resources 
will be requested from /w/static-VERSION/resources
-} else {
-       $wgResourceBasePath = 
"//{$wmfHostnames['bits']}/static-$wmfVersionNumber"; // This means resources 
will be requested from /static-VERSION/resources
-}
+$wgLoadScript = "{$wgServer}/w/load.php";
+$wgExtensionAssetsPath = "{$wgServer}/static/{$wmfVersionNumber}/extensions";
+$wgStyleSheetPath = "{$wgServer}/static/{$wmfVersionNumber}/skins";
+$wgResourceBasePath = "{$wgServer}/static/{$wmfVersionNumber}";
 
 $wgStylePath = $wgStyleSheetPath;
 $wgArticlePath = "/wiki/$1";
@@ -2643,11 +2631,11 @@
                // test2wiki has its own Schema: NS.
                $wgEventLoggingDBname = 'test2wiki';
                $wgEventLoggingSchemaApiUri = 
'http://test2.wikipedia.org/w/api.php';
-               $wgEventLoggingBaseUri = "//{$wmgAssetsHost}/beacon/dummy";
+               $wgEventLoggingBaseUri = "{$wgServer}/beacon/dummy";
                $wgEventLoggingFile = 
"udp://$wmfUdp2logDest/EventLogging-$wgDBname";
        } else {
                // All other wikis reference metawiki.
-               $wgEventLoggingBaseUri = "//{$wmgAssetsHost}/beacon/event";
+               $wgEventLoggingBaseUri = "{$wgServer}/beacon/event";
                $wgEventLoggingDBname = 'metawiki';
                $wgEventLoggingFile = 'udp://10.64.32.167:8421/EventLogging';  
// eventlog1001.eqiad.wmnet
                $wgEventLoggingSchemaApiUri = 
'http://meta.wikimedia.org/w/api.php';
@@ -2705,7 +2693,7 @@
        // re-downloading of fonts for each new branch. But that only works for 
production,
        // not labs. If this variable is not set, $wgExtensionAssetsPath is 
used.
        if ( $wmfRealm === 'production' ) {
-               $wgULSFontRepositoryBasePath = ( '//' . $wmgAssetsHost . 
'/static/current'
+               $wgULSFontRepositoryBasePath = ( $wgServer . '/static/current'
                        . 
'/extensions/UniversalLanguageSelector/data/fontrepo/fonts/' );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/209786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6236f5e2c5026867f797b1b2813c98554fd59e22
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to