Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php |
— | — | @@ -138,13 +138,18 @@ |
139 | 139 | # Language forced from some hacky script like extract2.php |
140 | 140 | $lang = getenv( 'MW_LANG' ); |
141 | 141 | } elseif ( preg_match( '/^(?:\/usr\/local\/apache\/|\/home\/wikipedia\/)(?:htdocs|common\/docroot)\/([a-z]+)\.org/', $docRoot, $matches ) ) { |
| 142 | + # This is the poor man / hacky routing engine for WMF cluster |
142 | 143 | $site = $matches[1]; |
143 | 144 | if ( preg_match( '/^(.*)\.' . preg_quote( $site ) . '\.org$/', $serverName, $matches ) ) { |
144 | 145 | $lang = $matches[1]; |
145 | 146 | // For some special subdomains, like pa.us |
146 | 147 | $lang = str_replace( '.', '-', $lang ); |
147 | 148 | } else if ( preg_match( '/^(.*)\.prototype\.wikimedia\.org$/', $serverName, $matches ) ) { |
| 149 | + // http://en.prototype.wikimedia.org/ |
148 | 150 | $lang = $matches[1]; |
| 151 | + } else if ( preg_match( '/^([^.]+)\.[^.]+\.beta\.wmflabs\.org$/', $serverName, $matches ) ) { |
| 152 | + // http://en.wikipedia.beta.wmflabs.org/ |
| 153 | + $lang = $matches[1]; |
149 | 154 | } else { |
150 | 155 | self::error( "Invalid host name ($serverName), can't determine language.\n" ); |
151 | 156 | } |