r89620 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89619‎ | r89620 | r89621 >
Date:00:26, 7 June 2011
Author:pdhanda
Status:deferred
Tags:
Comment:
First version of changes to CommonSetting - working on localhost and prototype.wikimedia.org. README to follow.
Modified paths:
  • /trunk/tools/mwmultiversion/wmf-config/CommonSettings.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php
@@ -46,12 +46,13 @@
4747
4848 #----------------------------------------------------------------------
4949 # Initialisation
50 -
 50+/*
5151 if ( defined( 'TESTWIKI' ) ) {
5252 $IP = "/home/wikipedia/common/php-1.17";
5353 } else {
5454 $IP = "/usr/local/apache/common/php-1.17";
5555 }
 56+*/
5657 //ini_set( "include_path", "$IP:$IP/includes:$IP/languages:$IP/templates:$IP/lib:$IP/extensions/wikihiero:/usr/local/lib/php:/usr/share/php" );
5758 // Modernized BV -- 2009-7-14
5859 set_include_path( "$IP:$IP/lib:/usr/local/lib/php:/usr/share/php" );
@@ -162,6 +163,14 @@
163164 }
164165 $wgDBname = str_replace( "-", "_", $lang . $dbSuffix );
165166
 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+
166175 # Shutting eswiki down
167176 #if ( $wgDBname == 'eswiki' && php_sapi_name() != 'cli' ) { die(); }
168177
@@ -169,12 +178,12 @@
170179
171180 # Initialise wgConf
172181 wfProfileIn( "$fname-wgConf" );
173 -require( "$IP/wmf-config/wgConf.php" );
 182+require( "$IP/../wmf-config/wgConf.php" );
174183
175184 function wmfLoadInitialiseSettings( $conf ) {
176185 global $IP;
177186 $wgConf =& $conf; # b/c alias
178 - require( "$IP/wmf-config/InitialiseSettings.php" );
 187+ require( "$IP/../wmf-config/InitialiseSettings.php" );
179188 }
180189
181190 wfProfileOut( "$fname-wgConf" );
@@ -186,16 +195,16 @@
187196 if ( $wgCommandLineMode) {
188197 print "Database name $wgDBname is not listed in $cluster.dblist\n";
189198 } else {
190 - require( "$IP/wmf-config/missing.php" );
 199+ require( "$IP/../wmf-config/missing.php" );
191200 }
192201 exit;
193202 }
194203
195204 # Try configuration cache
196205
197 -$filename = "/tmp/mw-cache-1.17/conf-$wgDBname";
 206+$filename = "/tmp/mw-cache-$wgVersionDirectory/conf-$wgDBname";
198207 $globals = false;
199 -if ( @filemtime( $filename ) >= filemtime( "$IP/wmf-config/InitialiseSettings.php" ) ) {
 208+if ( @filemtime( $filename ) >= filemtime( "$IP/../wmf-config/InitialiseSettings.php" ) ) {
200209 $cacheRecord = @file_get_contents( $filename );
201210 if ( $cacheRecord !== false ) {
202211 $globals = unserialize( $cacheRecord );
@@ -205,7 +214,7 @@
206215 if ( !$globals ) {
207216 wfProfileIn( "$fname-recache-settings" );
208217 # Get configuration from SiteConfiguration object
209 - require( "$IP/wmf-config/InitialiseSettings.php" );
 218+ require( "$IP/../wmf-config/InitialiseSettings.php" );
210219
211220 $wikiTags = array();
212221 foreach ( array( 'private', 'fishbowl', 'special', 'closed', 'flaggedrevs', 'readonly', 'switchover-jun30' ) as $tag ) {
@@ -225,7 +234,7 @@
226235
227236 # Save cache
228237 $oldUmask = umask( 0 );
229 - @mkdir( '/tmp/mw-cache-1.17', 0777 );
 238+ @mkdir( '/tmp/mw-cache-' . $wgVersionDirectory, 0777 );
230239 $file = fopen( $filename, 'w' );
231240 if ( $file ) {
232241 fwrite( $file, serialize( $globals ) );
@@ -245,11 +254,11 @@
246255
247256 # Private settings such as passwords, that shouldn't be published
248257 # Needs to be before db.php
249 -require( "$IP/wmf-config/PrivateSettings.php" );
 258+require( "$IP/../wmf-config/PrivateSettings.php" );
250259
251260 # 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");
254263
255264
256265 setlocale( LC_ALL, 'en_US.UTF-8' );
@@ -259,18 +268,18 @@
260269 #$wgStyleSheetPath = '/w/skins-1.17';
261270 if ( $wgDBname == 'testwiki' ) {
262271 // 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;
265274
266275 } 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;
269278 }
270279 $wgStylePath = $wgStyleSheetPath;
271280 $wgArticlePath = "/wiki/$1";
272281
273282 $wgScriptPath = '/w';
274 -$wgLocalStylePath = "$wgScriptPath/skins-1.17";
 283+$wgLocalStylePath = "$wgScriptPath/skins-$wgVersionDirectory";
275284 $wgStockPath = '/images';
276285 $wgScript = $wgScriptPath.'/index.php';
277286 $wgRedirectScript = $wgScriptPath.'/redirect.php';
@@ -854,7 +863,7 @@
855864
856865 // Per-wiki config for Flagged Revisions
857866 if ( $wmgUseFlaggedRevs ) {
858 - include( $IP.'/wmf-config/flaggedrevs.php');
 867+ include( $IP.'/../wmf-config/flaggedrevs.php');
859868 }
860869
861870 $wgUseAjax = true;
@@ -865,7 +874,7 @@
866875 if ( $wmgUseProofreadPage ) {
867876 //if ( $wgDBname == 'frwikisource' || $wgDBname == 'enwikisource' || $wgDBname == 'ptwikisource' ) {
868877 include( $IP . '/extensions/ProofreadPage/ProofreadPage.php' );
869 - include( $IP . '/wmf-config/proofreadpage.php');
 878+ include( $IP . '/../wmf-config/proofreadpage.php');
870879 }
871880 if( $wmgUseLST ) {
872881 include( $IP . '/extensions/LabeledSectionTransclusion/lst.php' );
@@ -914,7 +923,7 @@
915924 include( "$IP/extensions/skins/Donate/Donate.php" );
916925
917926 include( "$IP/extensions/ContributionReporting/ContributionReporting.php" );
918 - include( "$IP/wmf-config/reporting-setup.php");
 927+ include( "$IP/../wmf-config/reporting-setup.php");
919928
920929 include( "$IP/extensions/ContactPageFundraiser/ContactPage.php" );
921930 $wgContactUser = 'Storiescontact';
@@ -1082,7 +1091,7 @@
10831092
10841093 // PoolCounter
10851094 if ( $wmgUsePoolCounter ) {
1086 - include( "$IP/wmf-config/PoolCounterSettings.php" );
 1095+ include( "$IP/../wmf-config/PoolCounterSettings.php" );
10871096 }
10881097
10891098 wfProfileOut( "$fname-ext-include1" );
@@ -1243,7 +1252,7 @@
12441253
12451254 if( $wgUseLuceneSearch ) {
12461255 wfProfileIn( "$fname-lucene" );
1247 - include( $IP.'/wmf-config/lucene.php' );
 1256+ include( $IP.'/../wmf-config/lucene.php' );
12481257 wfProfileOut( "$fname-lucene" );
12491258 }
12501259
@@ -1458,7 +1467,7 @@
14591468 #$mwBlockerHost = 'larousse';
14601469 #$mwBlockerPort = 8126;
14611470 ##$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";
14631472
14641473 if( getenv( 'WIKIDEBUG' ) ) {
14651474 $wgDebugLogFile = '/tmp/wiki.log';
@@ -1486,7 +1495,7 @@
14871496 $wgBrowserBlackList[] = '/^Lynx/';
14881497
14891498 // Vandal checks
1490 -require( $IP.'/wmf-config/checkers.php' );
 1499+require( $IP.'/../wmf-config/checkers.php' );
14911500
14921501 // Experimental ScanSet extension
14931502 if ( $wgDBname == 'enwikisource' ) {
@@ -1527,7 +1536,7 @@
15281537
15291538 // Customize URL handling for secure.wikimedia.org HTTPS logins
15301539 if( $secure ) {
1531 - require( "$IP/wmf-config/secure.php" );
 1540+ require( "$IP/../wmf-config/secure.php" );
15321541 } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
15331542 // New HTTPS service on regular URLs
15341543 $wgServer = preg_replace( '/^http:/', 'https:', $wgServer );
@@ -1953,7 +1962,7 @@
19541963 }
19551964
19561965 // Testing internally
1957 -include "$IP/wmf-config/secret-projects.php";
 1966+include "$IP/../wmf-config/secret-projects.php";
19581967
19591968 /*
19601969 if ( $wgDBname == 'idwiki' ) {
@@ -2011,7 +2020,7 @@
20122021
20132022 if( $wmgUseCodeReview ) {
20142023 include "$IP/extensions/CodeReview/CodeReview.php";
2015 - include( $IP.'/wmf-config/codereview.php');
 2024+ include( $IP.'/../wmf-config/codereview.php');
20162025 $wgSubversionProxy = 'http://codereview-proxy.wikimedia.org/index.php';
20172026
20182027 $wgGroupPermissions['user']['codereview-add-tag'] = false;
@@ -2043,7 +2052,7 @@
20442053
20452054 if( $wmgUseAbuseFilter ) {
20462055 include "$IP/extensions/AbuseFilter/AbuseFilter.php";
2047 - include( $IP.'/wmf-config/abusefilter.php');
 2056+ include( $IP.'/../wmf-config/abusefilter.php');
20482057 }
20492058
20502059 if ($wmgUseCommunityVoice == true) {
@@ -2177,7 +2186,7 @@
21782187 }
21792188
21802189 if ( $wmgUseLiquidThreads ) {
2181 - require_once( "$IP/wmf-config/liquidthreads.php" );
 2190+ require_once( "$IP/../wmf-config/liquidthreads.php" );
21822191 }
21832192
21842193 if ( $wmgUseFundraiserPortal ) {
@@ -2322,7 +2331,7 @@
23232332 // ContributionTracking for handling PayPal redirects
23242333 if ( $wgUseContributionTracking ) {
23252334 include( "$IP/extensions/ContributionTracking/ContributionTracking.php" );
2326 - include( "$IP/wmf-config/contribution-tracking-setup.php");
 2335+ include( "$IP/../wmf-config/contribution-tracking-setup.php");
23272336 $wgContributionTrackingPayPalIPN = "https://civicrm.wikimedia.org/fundcore_gateway/paypal";
23282337 $wgContributionTrackingPayPalRecurringIPN = "https://civicrm.wikimedia.org/IPNListener_Recurring.php";
23292338 }
@@ -2412,7 +2421,7 @@
24132422 #
24142423 # REALlY ... were not kidding here ... NO EXTENSIONS AFTER
24152424
2416 -require( "$IP/wmf-config/ExtensionMessages.php" );
 2425+require( "$IP/../wmf-config/ExtensionMessages.php" );
24172426
24182427 wfProfileOut( "$fname-misc5" );
24192428 wfProfileOut( $fname );

Status & tagging log