Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php |
— | — | @@ -46,12 +46,13 @@ |
47 | 47 | |
48 | 48 | #---------------------------------------------------------------------- |
49 | 49 | # Initialisation |
50 | | - |
| 50 | +/* |
51 | 51 | if ( defined( 'TESTWIKI' ) ) { |
52 | 52 | $IP = "/home/wikipedia/common/php-1.17"; |
53 | 53 | } else { |
54 | 54 | $IP = "/usr/local/apache/common/php-1.17"; |
55 | 55 | } |
| 56 | +*/ |
56 | 57 | //ini_set( "include_path", "$IP:$IP/includes:$IP/languages:$IP/templates:$IP/lib:$IP/extensions/wikihiero:/usr/local/lib/php:/usr/share/php" ); |
57 | 58 | // Modernized BV -- 2009-7-14 |
58 | 59 | set_include_path( "$IP:$IP/lib:/usr/local/lib/php:/usr/share/php" ); |
— | — | @@ -162,6 +163,14 @@ |
163 | 164 | } |
164 | 165 | $wgDBname = str_replace( "-", "_", $lang . $dbSuffix ); |
165 | 166 | |
| 167 | +//changed for hetdeploy testing --pdhanda |
| 168 | +$match = array(); |
| 169 | +if ( preg_match("/^[0-9.]*/", $wgVersion, $match) ) { |
| 170 | + $wgVersionDirectory = $match[0]; |
| 171 | +} else { |
| 172 | + $wgVersionDirectory = "1.17"; |
| 173 | +} |
| 174 | + |
166 | 175 | # Shutting eswiki down |
167 | 176 | #if ( $wgDBname == 'eswiki' && php_sapi_name() != 'cli' ) { die(); } |
168 | 177 | |
— | — | @@ -169,12 +178,12 @@ |
170 | 179 | |
171 | 180 | # Initialise wgConf |
172 | 181 | wfProfileIn( "$fname-wgConf" ); |
173 | | -require( "$IP/wmf-config/wgConf.php" ); |
| 182 | +require( "$IP/../wmf-config/wgConf.php" ); |
174 | 183 | |
175 | 184 | function wmfLoadInitialiseSettings( $conf ) { |
176 | 185 | global $IP; |
177 | 186 | $wgConf =& $conf; # b/c alias |
178 | | - require( "$IP/wmf-config/InitialiseSettings.php" ); |
| 187 | + require( "$IP/../wmf-config/InitialiseSettings.php" ); |
179 | 188 | } |
180 | 189 | |
181 | 190 | wfProfileOut( "$fname-wgConf" ); |
— | — | @@ -186,16 +195,16 @@ |
187 | 196 | if ( $wgCommandLineMode) { |
188 | 197 | print "Database name $wgDBname is not listed in $cluster.dblist\n"; |
189 | 198 | } else { |
190 | | - require( "$IP/wmf-config/missing.php" ); |
| 199 | + require( "$IP/../wmf-config/missing.php" ); |
191 | 200 | } |
192 | 201 | exit; |
193 | 202 | } |
194 | 203 | |
195 | 204 | # Try configuration cache |
196 | 205 | |
197 | | -$filename = "/tmp/mw-cache-1.17/conf-$wgDBname"; |
| 206 | +$filename = "/tmp/mw-cache-$wgVersionDirectory/conf-$wgDBname"; |
198 | 207 | $globals = false; |
199 | | -if ( @filemtime( $filename ) >= filemtime( "$IP/wmf-config/InitialiseSettings.php" ) ) { |
| 208 | +if ( @filemtime( $filename ) >= filemtime( "$IP/../wmf-config/InitialiseSettings.php" ) ) { |
200 | 209 | $cacheRecord = @file_get_contents( $filename ); |
201 | 210 | if ( $cacheRecord !== false ) { |
202 | 211 | $globals = unserialize( $cacheRecord ); |
— | — | @@ -205,7 +214,7 @@ |
206 | 215 | if ( !$globals ) { |
207 | 216 | wfProfileIn( "$fname-recache-settings" ); |
208 | 217 | # Get configuration from SiteConfiguration object |
209 | | - require( "$IP/wmf-config/InitialiseSettings.php" ); |
| 218 | + require( "$IP/../wmf-config/InitialiseSettings.php" ); |
210 | 219 | |
211 | 220 | $wikiTags = array(); |
212 | 221 | foreach ( array( 'private', 'fishbowl', 'special', 'closed', 'flaggedrevs', 'readonly', 'switchover-jun30' ) as $tag ) { |
— | — | @@ -225,7 +234,7 @@ |
226 | 235 | |
227 | 236 | # Save cache |
228 | 237 | $oldUmask = umask( 0 ); |
229 | | - @mkdir( '/tmp/mw-cache-1.17', 0777 ); |
| 238 | + @mkdir( '/tmp/mw-cache-' . $wgVersionDirectory, 0777 ); |
230 | 239 | $file = fopen( $filename, 'w' ); |
231 | 240 | if ( $file ) { |
232 | 241 | fwrite( $file, serialize( $globals ) ); |
— | — | @@ -245,11 +254,11 @@ |
246 | 255 | |
247 | 256 | # Private settings such as passwords, that shouldn't be published |
248 | 257 | # Needs to be before db.php |
249 | | -require( "$IP/wmf-config/PrivateSettings.php" ); |
| 258 | +require( "$IP/../wmf-config/PrivateSettings.php" ); |
250 | 259 | |
251 | 260 | # Cluster-dependent files for database and memcached |
252 | | -require( "$IP/wmf-config/db.php" ); |
253 | | -require("$IP/wmf-config/mc.php"); |
| 261 | +require( "$IP/../wmf-config/db.php" ); |
| 262 | +require("$IP/../wmf-config/mc.php"); |
254 | 263 | |
255 | 264 | |
256 | 265 | setlocale( LC_ALL, 'en_US.UTF-8' ); |
— | — | @@ -259,18 +268,18 @@ |
260 | 269 | #$wgStyleSheetPath = '/w/skins-1.17'; |
261 | 270 | if ( $wgDBname == 'testwiki' ) { |
262 | 271 | // Make testing skin/JS changes easier |
263 | | - $wgExtensionAssetsPath = 'http://test.wikipedia.org/w/extensions-1.17'; |
264 | | - $wgStyleSheetPath = 'http://test.wikipedia.org/w/skins-1.17'; |
| 272 | + $wgExtensionAssetsPath = 'http://test.wikipedia.org/w/extensions-' . $wgVersionDirectory; |
| 273 | + $wgStyleSheetPath = 'http://test.wikipedia.org/w/skins-' . $wgVersionDirectory; |
265 | 274 | |
266 | 275 | } else { |
267 | | - $wgExtensionAssetsPath = 'http://bits.wikimedia.org/w/extensions-1.17'; |
268 | | - $wgStyleSheetPath = 'http://bits.wikimedia.org/skins-1.17'; |
| 276 | + $wgExtensionAssetsPath = 'http://bits.wikimedia.org/w/extensions-' . $wgVersionDirectory; |
| 277 | + $wgStyleSheetPath = 'http://bits.wikimedia.org/skins-' . $wgVersionDirectory; |
269 | 278 | } |
270 | 279 | $wgStylePath = $wgStyleSheetPath; |
271 | 280 | $wgArticlePath = "/wiki/$1"; |
272 | 281 | |
273 | 282 | $wgScriptPath = '/w'; |
274 | | -$wgLocalStylePath = "$wgScriptPath/skins-1.17"; |
| 283 | +$wgLocalStylePath = "$wgScriptPath/skins-$wgVersionDirectory"; |
275 | 284 | $wgStockPath = '/images'; |
276 | 285 | $wgScript = $wgScriptPath.'/index.php'; |
277 | 286 | $wgRedirectScript = $wgScriptPath.'/redirect.php'; |
— | — | @@ -854,7 +863,7 @@ |
855 | 864 | |
856 | 865 | // Per-wiki config for Flagged Revisions |
857 | 866 | if ( $wmgUseFlaggedRevs ) { |
858 | | - include( $IP.'/wmf-config/flaggedrevs.php'); |
| 867 | + include( $IP.'/../wmf-config/flaggedrevs.php'); |
859 | 868 | } |
860 | 869 | |
861 | 870 | $wgUseAjax = true; |
— | — | @@ -865,7 +874,7 @@ |
866 | 875 | if ( $wmgUseProofreadPage ) { |
867 | 876 | //if ( $wgDBname == 'frwikisource' || $wgDBname == 'enwikisource' || $wgDBname == 'ptwikisource' ) { |
868 | 877 | include( $IP . '/extensions/ProofreadPage/ProofreadPage.php' ); |
869 | | - include( $IP . '/wmf-config/proofreadpage.php'); |
| 878 | + include( $IP . '/../wmf-config/proofreadpage.php'); |
870 | 879 | } |
871 | 880 | if( $wmgUseLST ) { |
872 | 881 | include( $IP . '/extensions/LabeledSectionTransclusion/lst.php' ); |
— | — | @@ -914,7 +923,7 @@ |
915 | 924 | include( "$IP/extensions/skins/Donate/Donate.php" ); |
916 | 925 | |
917 | 926 | include( "$IP/extensions/ContributionReporting/ContributionReporting.php" ); |
918 | | - include( "$IP/wmf-config/reporting-setup.php"); |
| 927 | + include( "$IP/../wmf-config/reporting-setup.php"); |
919 | 928 | |
920 | 929 | include( "$IP/extensions/ContactPageFundraiser/ContactPage.php" ); |
921 | 930 | $wgContactUser = 'Storiescontact'; |
— | — | @@ -1082,7 +1091,7 @@ |
1083 | 1092 | |
1084 | 1093 | // PoolCounter |
1085 | 1094 | if ( $wmgUsePoolCounter ) { |
1086 | | - include( "$IP/wmf-config/PoolCounterSettings.php" ); |
| 1095 | + include( "$IP/../wmf-config/PoolCounterSettings.php" ); |
1087 | 1096 | } |
1088 | 1097 | |
1089 | 1098 | wfProfileOut( "$fname-ext-include1" ); |
— | — | @@ -1243,7 +1252,7 @@ |
1244 | 1253 | |
1245 | 1254 | if( $wgUseLuceneSearch ) { |
1246 | 1255 | wfProfileIn( "$fname-lucene" ); |
1247 | | - include( $IP.'/wmf-config/lucene.php' ); |
| 1256 | + include( $IP.'/../wmf-config/lucene.php' ); |
1248 | 1257 | wfProfileOut( "$fname-lucene" ); |
1249 | 1258 | } |
1250 | 1259 | |
— | — | @@ -1458,7 +1467,7 @@ |
1459 | 1468 | #$mwBlockerHost = 'larousse'; |
1460 | 1469 | #$mwBlockerPort = 8126; |
1461 | 1470 | ##$wgProxyList = array_flip( array_map( 'trim', file( 'udp://10.0.5.8:8420/mwblocker' ) ) ); |
1462 | | -$wgProxyList = "$IP/wmf-config/mwblocker.log"; |
| 1471 | +$wgProxyList = "$IP/../wmf-config/mwblocker.log"; |
1463 | 1472 | |
1464 | 1473 | if( getenv( 'WIKIDEBUG' ) ) { |
1465 | 1474 | $wgDebugLogFile = '/tmp/wiki.log'; |
— | — | @@ -1486,7 +1495,7 @@ |
1487 | 1496 | $wgBrowserBlackList[] = '/^Lynx/'; |
1488 | 1497 | |
1489 | 1498 | // Vandal checks |
1490 | | -require( $IP.'/wmf-config/checkers.php' ); |
| 1499 | +require( $IP.'/../wmf-config/checkers.php' ); |
1491 | 1500 | |
1492 | 1501 | // Experimental ScanSet extension |
1493 | 1502 | if ( $wgDBname == 'enwikisource' ) { |
— | — | @@ -1527,7 +1536,7 @@ |
1528 | 1537 | |
1529 | 1538 | // Customize URL handling for secure.wikimedia.org HTTPS logins |
1530 | 1539 | if( $secure ) { |
1531 | | - require( "$IP/wmf-config/secure.php" ); |
| 1540 | + require( "$IP/../wmf-config/secure.php" ); |
1532 | 1541 | } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) { |
1533 | 1542 | // New HTTPS service on regular URLs |
1534 | 1543 | $wgServer = preg_replace( '/^http:/', 'https:', $wgServer ); |
— | — | @@ -1953,7 +1962,7 @@ |
1954 | 1963 | } |
1955 | 1964 | |
1956 | 1965 | // Testing internally |
1957 | | -include "$IP/wmf-config/secret-projects.php"; |
| 1966 | +include "$IP/../wmf-config/secret-projects.php"; |
1958 | 1967 | |
1959 | 1968 | /* |
1960 | 1969 | if ( $wgDBname == 'idwiki' ) { |
— | — | @@ -2011,7 +2020,7 @@ |
2012 | 2021 | |
2013 | 2022 | if( $wmgUseCodeReview ) { |
2014 | 2023 | include "$IP/extensions/CodeReview/CodeReview.php"; |
2015 | | - include( $IP.'/wmf-config/codereview.php'); |
| 2024 | + include( $IP.'/../wmf-config/codereview.php'); |
2016 | 2025 | $wgSubversionProxy = 'http://codereview-proxy.wikimedia.org/index.php'; |
2017 | 2026 | |
2018 | 2027 | $wgGroupPermissions['user']['codereview-add-tag'] = false; |
— | — | @@ -2043,7 +2052,7 @@ |
2044 | 2053 | |
2045 | 2054 | if( $wmgUseAbuseFilter ) { |
2046 | 2055 | include "$IP/extensions/AbuseFilter/AbuseFilter.php"; |
2047 | | - include( $IP.'/wmf-config/abusefilter.php'); |
| 2056 | + include( $IP.'/../wmf-config/abusefilter.php'); |
2048 | 2057 | } |
2049 | 2058 | |
2050 | 2059 | if ($wmgUseCommunityVoice == true) { |
— | — | @@ -2177,7 +2186,7 @@ |
2178 | 2187 | } |
2179 | 2188 | |
2180 | 2189 | if ( $wmgUseLiquidThreads ) { |
2181 | | - require_once( "$IP/wmf-config/liquidthreads.php" ); |
| 2190 | + require_once( "$IP/../wmf-config/liquidthreads.php" ); |
2182 | 2191 | } |
2183 | 2192 | |
2184 | 2193 | if ( $wmgUseFundraiserPortal ) { |
— | — | @@ -2322,7 +2331,7 @@ |
2323 | 2332 | // ContributionTracking for handling PayPal redirects |
2324 | 2333 | if ( $wgUseContributionTracking ) { |
2325 | 2334 | include( "$IP/extensions/ContributionTracking/ContributionTracking.php" ); |
2326 | | - include( "$IP/wmf-config/contribution-tracking-setup.php"); |
| 2335 | + include( "$IP/../wmf-config/contribution-tracking-setup.php"); |
2327 | 2336 | $wgContributionTrackingPayPalIPN = "https://civicrm.wikimedia.org/fundcore_gateway/paypal"; |
2328 | 2337 | $wgContributionTrackingPayPalRecurringIPN = "https://civicrm.wikimedia.org/IPNListener_Recurring.php"; |
2329 | 2338 | } |
— | — | @@ -2412,7 +2421,7 @@ |
2413 | 2422 | # |
2414 | 2423 | # REALlY ... were not kidding here ... NO EXTENSIONS AFTER |
2415 | 2424 | |
2416 | | -require( "$IP/wmf-config/ExtensionMessages.php" ); |
| 2425 | +require( "$IP/../wmf-config/ExtensionMessages.php" ); |
2417 | 2426 | |
2418 | 2427 | wfProfileOut( "$fname-misc5" ); |
2419 | 2428 | wfProfileOut( $fname ); |