Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki-CVS
SVN: [115399] trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
 

Index | Next | Previous | View Flat


hashar at svn

May 18, 2012, 3:02 AM


Views: 80
Permalink
SVN: [115399] trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php

https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115399

Revision: 115399
Author: hashar
Date: 2012-05-18 10:02:09 +0000 (Fri, 18 May 2012)
Log Message:
-----------
support for [lang].[project].beta.wmflabs.org URLs

Modified Paths:
--------------
trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php

Modified: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
===================================================================
--- trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php 2012-05-18 09:54:44 UTC (rev 115398)
+++ trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php 2012-05-18 10:02:09 UTC (rev 115399)
@@ -138,13 +138,18 @@
# Language forced from some hacky script like extract2.php
$lang = getenv( 'MW_LANG' );
} elseif ( preg_match( '/^(?:\/usr\/local\/apache\/|\/home\/wikipedia\/)(?:htdocs|common\/docroot)\/([a-z]+)\.org/', $docRoot, $matches ) ) {
+ # This is the poor man / hacky routing engine for WMF cluster
$site = $matches[1];
if ( preg_match( '/^(.*)\.' . preg_quote( $site ) . '\.org$/', $serverName, $matches ) ) {
$lang = $matches[1];
// For some special subdomains, like pa.us
$lang = str_replace( '.', '-', $lang );
} else if ( preg_match( '/^(.*)\.prototype\.wikimedia\.org$/', $serverName, $matches ) ) {
+ // http://en.prototype.wikimedia.org/
$lang = $matches[1];
+ } else if ( preg_match( '/^([^.]+)\.[^.]+\.beta\.wmflabs\.org$/', $serverName, $matches ) ) {
+ // http://en.wikipedia.beta.wmflabs.org/
+ $lang = $matches[1];
} else {
self::error( "Invalid host name ($serverName), can't determine language.\n" );
}


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Subject User Time
SVN: [115399] trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php hashar at svn May 18, 2012, 3:02 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.