Index: trunk/tools/mwmultiversion/wmf-config/MWMultiVersion.php |
— | — | @@ -8,10 +8,10 @@ |
9 | 9 | * @var MWMultiVersion |
10 | 10 | */ |
11 | 11 | private static $instance; |
12 | | - |
| 12 | + /** |
| 13 | + * @var string |
| 14 | + */ |
13 | 15 | private $db; |
14 | | - private $site; |
15 | | - private $lang; |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * To get an inststance of this class, use the statuc helper methods. |
— | — | @@ -94,36 +94,36 @@ |
95 | 95 | if ( !preg_match('/^([^.]+)\.([^.]+)\./', $secure, $matches ) ) { |
96 | 96 | die( "invalid hostname" ); |
97 | 97 | } |
98 | | - $this->lang = $matches[1]; |
99 | | - $this->site = $matches[2]; |
| 98 | + $lang = $matches[1]; |
| 99 | + $site = $matches[2]; |
100 | 100 | |
101 | 101 | // @TODO: move/use some special case dblist? |
102 | 102 | $idioSyncratics = array( "commons", "grants", "sources", "wikimania", |
103 | 103 | "wikimania2006", "foundation", "meta" ); |
104 | | - if ( in_array( $this->lang, $idioSyncratics ) ) { |
105 | | - $this->site = "wikipedia"; |
| 104 | + if ( in_array( $lang, $idioSyncratics ) ) { |
| 105 | + $site = "wikipedia"; |
106 | 106 | } |
107 | 107 | } else { |
108 | | - $this->site = "wikipedia"; |
| 108 | + $site = "wikipedia"; |
109 | 109 | if ( preg_match( '/^(?:\/usr\/local\/apache\/|\/home\/wikipedia\/)(?:htdocs|common\/docroot)\/([a-z]+)\.org/', $docRoot, $matches ) ) { |
110 | | - $this->site = $matches[1]; |
111 | | - if ( preg_match( '/^(.*)\.' . preg_quote( $this->site ) . '\.org$/', $serverName, $matches ) ) { |
112 | | - $this->lang = $matches[1]; |
| 110 | + $site = $matches[1]; |
| 111 | + if ( preg_match( '/^(.*)\.' . preg_quote( $site ) . '\.org$/', $serverName, $matches ) ) { |
| 112 | + $lang = $matches[1]; |
113 | 113 | // For some special subdomains, like pa.us |
114 | | - $this->lang = str_replace( '.', '-', $this->lang ); |
| 114 | + $lang = str_replace( '.', '-', $lang ); |
115 | 115 | } else if ( preg_match( '/^(.*)\.prototype\.wikimedia\.org$/', $serverName, $matches ) ) { |
116 | | - $this->lang = $matches[1]; |
| 116 | + $lang = $matches[1]; |
117 | 117 | } else { |
118 | 118 | die( "Invalid host name ($serverName), can't determine language" ); |
119 | 119 | } |
120 | 120 | } elseif ( preg_match( "/^\/usr\/local\/apache\/(?:htdocs|common\/docroot)\/([a-z0-9\-_]*)$/", $docRoot, $matches ) ) { |
121 | | - $this->site = "wikipedia"; |
122 | | - $this->lang = $matches[1]; |
| 121 | + $site = "wikipedia"; |
| 122 | + $lang = $matches[1]; |
123 | 123 | } else { |
124 | 124 | die( "Invalid host name (docroot=" . $docRoot . "), can't determine language." ); |
125 | 125 | } |
126 | 126 | } |
127 | | - $this->loadDBFromSite( $this->site, $this->lang ); |
| 127 | + $this->loadDBFromSite( $site, $lang ); |
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
— | — | @@ -136,9 +136,9 @@ |
137 | 137 | if ( count( $pathBits ) < 3 ) { |
138 | 138 | die( "Invalid file path info (pathinfo=" . $pathInfo . "), can't determine language." ); |
139 | 139 | } |
140 | | - $this->site = $pathBits[1]; |
141 | | - $this->lang = $pathBits[2]; |
142 | | - $this->loadDBFromSite( $this->site, $this->lang ); |
| 140 | + $site = $pathBits[1]; |
| 141 | + $lang = $pathBits[2]; |
| 142 | + $this->loadDBFromSite( $site, $lang ); |
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
Index: trunk/tools/mwmultiversion/MWScript.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | die( "The MediaWiki script file \"{$file}\" does not exist." ); |
44 | 44 | } |
45 | 45 | |
46 | | - # Run the script! |
| 46 | + # Run the script! (for HipHip, we will need to shell out here) |
47 | 47 | require_once( $file ); |
48 | 48 | } |
49 | 49 | |