Index: trunk/phase3/includes/Setup.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * This file is not a valid entry point, perform no further processing unless |
11 | 11 | * MEDIAWIKI is defined |
12 | 12 | */ |
13 | | -if( !defined( 'MEDIAWIKI' ) ) { |
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) { |
14 | 14 | exit( 1 ); |
15 | 15 | } |
16 | 16 | |
— | — | @@ -29,60 +29,62 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | // Set various default paths sensibly... |
33 | | -if( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension"; |
34 | | -if( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect$wgScriptExtension"; |
35 | | -if( $wgLoadScript === false ) $wgLoadScript = "$wgScriptPath/load$wgScriptExtension"; |
| 33 | +if ( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension"; |
| 34 | +if ( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect$wgScriptExtension"; |
| 35 | +if ( $wgLoadScript === false ) $wgLoadScript = "$wgScriptPath/load$wgScriptExtension"; |
36 | 36 | |
37 | | -if( $wgArticlePath === false ) { |
38 | | - if( $wgUsePathInfo ) { |
| 37 | +if ( $wgArticlePath === false ) { |
| 38 | + if ( $wgUsePathInfo ) { |
39 | 39 | $wgArticlePath = "$wgScript/$1"; |
40 | 40 | } else { |
41 | 41 | $wgArticlePath = "$wgScript?title=$1"; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | | -if( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins"; |
46 | | -if( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins"; |
47 | | -if( $wgStyleDirectory === false) $wgStyleDirectory = "$IP/skins"; |
48 | | -if( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions"; |
| 45 | +if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins"; |
| 46 | +if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins"; |
| 47 | +if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins"; |
| 48 | +if ( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions"; |
49 | 49 | |
50 | | -if( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png"; |
| 50 | +if ( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png"; |
51 | 51 | |
52 | | -if( $wgUploadPath === false ) $wgUploadPath = "$wgScriptPath/images"; |
53 | | -if( $wgUploadDirectory === false ) $wgUploadDirectory = "$IP/images"; |
| 52 | +if ( $wgUploadPath === false ) $wgUploadPath = "$wgScriptPath/images"; |
| 53 | +if ( $wgUploadDirectory === false ) $wgUploadDirectory = "$IP/images"; |
54 | 54 | |
55 | | -if( $wgMathPath === false ) $wgMathPath = "{$wgUploadPath}/math"; |
56 | | -if( $wgMathDirectory === false ) $wgMathDirectory = "{$wgUploadDirectory}/math"; |
57 | | -if( $wgTmpDirectory === false ) $wgTmpDirectory = "{$wgUploadDirectory}/tmp"; |
| 55 | +if ( $wgMathPath === false ) $wgMathPath = "{$wgUploadPath}/math"; |
| 56 | +if ( $wgMathDirectory === false ) $wgMathDirectory = "{$wgUploadDirectory}/math"; |
| 57 | +if ( $wgTmpDirectory === false ) $wgTmpDirectory = "{$wgUploadDirectory}/tmp"; |
58 | 58 | |
59 | | -if( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR"; |
60 | | -if( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache"; |
61 | | -if( $wgDeletedDirectory === false ) $wgDeletedDirectory = "{$wgUploadDirectory}/deleted"; |
| 59 | +if ( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR"; |
| 60 | +if ( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache"; |
| 61 | +if ( $wgDeletedDirectory === false ) $wgDeletedDirectory = "{$wgUploadDirectory}/deleted"; |
62 | 62 | |
63 | | -if( isset( $wgFileStore['deleted']['directory'] ) ) { |
| 63 | +if ( isset( $wgFileStore['deleted']['directory'] ) ) { |
64 | 64 | $wgDeletedDirectory = $wgFileStore['deleted']['directory']; |
65 | 65 | } |
66 | 66 | |
67 | | -if( isset($wgFooterIcons["copyright"]) && |
68 | | - isset($wgFooterIcons["copyright"]["copyright"]) && |
69 | | - $wgFooterIcons["copyright"]["copyright"] === array() ) { |
| 67 | +if ( isset( $wgFooterIcons['copyright'] ) && |
| 68 | + isset( $wgFooterIcons['copyright']['copyright'] ) && |
| 69 | + $wgFooterIcons['copyright']['copyright'] === array() ) |
| 70 | +{ |
70 | 71 | if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) { |
71 | | - $wgFooterIcons["copyright"]["copyright"] = $wgCopyrightIcon; |
| 72 | + $wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon; |
72 | 73 | } elseif ( $wgRightsIcon || $wgRightsText ) { |
73 | | - $wgFooterIcons["copyright"]["copyright"] = array( |
74 | | - "url" => $wgRightsUrl, |
75 | | - "src" => $wgRightsIcon, |
76 | | - "alt" => $wgRightsText, |
| 74 | + $wgFooterIcons['copyright']['copyright'] = array( |
| 75 | + 'url' => $wgRightsUrl, |
| 76 | + 'src' => $wgRightsIcon, |
| 77 | + 'alt' => $wgRightsText, |
77 | 78 | ); |
78 | 79 | } else { |
79 | | - unset($wgFooterIcons["copyright"]["copyright"]); |
| 80 | + unset( $wgFooterIcons['copyright']['copyright'] ); |
80 | 81 | } |
81 | 82 | } |
82 | 83 | |
83 | | -if( isset($wgFooterIcons["poweredby"]) && |
84 | | - isset($wgFooterIcons["poweredby"]["mediawiki"]) && |
85 | | - $wgFooterIcons["poweredby"]["mediawiki"]["src"] === null ) { |
86 | | - $wgFooterIcons["poweredby"]["mediawiki"]["src"] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"; |
| 84 | +if ( isset( $wgFooterIcons['poweredby'] ) && |
| 85 | + isset( $wgFooterIcons['poweredby']['mediawiki'] ) && |
| 86 | + $wgFooterIcons['poweredby']['mediawiki']['src'] === null ) |
| 87 | +{ |
| 88 | + $wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"; |
87 | 89 | } |
88 | 90 | |
89 | 91 | /** |
— | — | @@ -106,7 +108,7 @@ |
107 | 109 | * Initialise $wgLocalFileRepo from backwards-compatible settings |
108 | 110 | */ |
109 | 111 | if ( !$wgLocalFileRepo ) { |
110 | | - if( isset( $wgFileStore['deleted']['hash'] ) ) { |
| 112 | + if ( isset( $wgFileStore['deleted']['hash'] ) ) { |
111 | 113 | $deletedHashLevel = $wgFileStore['deleted']['hash']; |
112 | 114 | } else { |
113 | 115 | $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0; |
— | — | @@ -143,7 +145,7 @@ |
144 | 146 | 'dbUser' => $wgDBuser, |
145 | 147 | 'dbPassword' => $wgDBpassword, |
146 | 148 | 'dbName' => $wgSharedUploadDBname, |
147 | | - 'dbFlags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT, |
| 149 | + 'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT, |
148 | 150 | 'tablePrefix' => $wgSharedUploadDBprefix, |
149 | 151 | 'hasSharedCache' => $wgCacheSharedUploads, |
150 | 152 | 'descBaseUrl' => $wgRepositoryBaseUrl, |
— | — | @@ -163,7 +165,7 @@ |
164 | 166 | ); |
165 | 167 | } |
166 | 168 | } |
167 | | -if( $wgUseInstantCommons ) { |
| 169 | +if ( $wgUseInstantCommons ) { |
168 | 170 | $wgForeignFileRepos[] = array( |
169 | 171 | 'class' => 'ForeignAPIRepo', |
170 | 172 | 'name' => 'wikimediacommons', |
— | — | @@ -176,12 +178,12 @@ |
177 | 179 | } |
178 | 180 | |
179 | 181 | if ( $wgRCFilterByAge ) { |
180 | | - ## Trim down $wgRCLinkDays so that it only lists links which are valid |
181 | | - ## as determined by $wgRCMaxAge. |
182 | | - ## Note that we allow 1 link higher than the max for things like 56 days but a 60 day link. |
| 182 | + # # Trim down $wgRCLinkDays so that it only lists links which are valid |
| 183 | + # # as determined by $wgRCMaxAge. |
| 184 | + # # Note that we allow 1 link higher than the max for things like 56 days but a 60 day link. |
183 | 185 | sort( $wgRCLinkDays ); |
184 | | - for( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) { |
185 | | - if( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) { |
| 186 | + for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) { |
| 187 | + if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) { |
186 | 188 | $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false ); |
187 | 189 | break; |
188 | 190 | } |
— | — | @@ -208,7 +210,7 @@ |
209 | 211 | $wgCookiePrefix = $wgDBname; |
210 | 212 | } |
211 | 213 | } |
212 | | -$wgCookiePrefix = strtr( $wgCookiePrefix, "=,; +.\"'\\[", "__________" ); |
| 214 | +$wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' ); |
213 | 215 | |
214 | 216 | $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; |
215 | 217 | |
— | — | @@ -271,20 +273,20 @@ |
272 | 274 | require_once( "$IP/includes/AutoLoader.php" ); |
273 | 275 | } |
274 | 276 | |
275 | | -wfProfileIn( $fname.'-exception' ); |
| 277 | +wfProfileIn( $fname . '-exception' ); |
276 | 278 | require_once( "$IP/includes/Exception.php" ); |
277 | 279 | wfInstallExceptionHandler(); |
278 | | -wfProfileOut( $fname.'-exception' ); |
| 280 | +wfProfileOut( $fname . '-exception' ); |
279 | 281 | |
280 | | -wfProfileIn( $fname.'-includes' ); |
| 282 | +wfProfileIn( $fname . '-includes' ); |
281 | 283 | require_once( "$IP/includes/GlobalFunctions.php" ); |
282 | 284 | require_once( "$IP/includes/Hooks.php" ); |
283 | 285 | require_once( "$IP/includes/Namespace.php" ); |
284 | 286 | require_once( "$IP/includes/ProxyTools.php" ); |
285 | 287 | require_once( "$IP/includes/ObjectCache.php" ); |
286 | 288 | require_once( "$IP/includes/ImageFunctions.php" ); |
287 | | -wfProfileOut( $fname.'-includes' ); |
288 | | -wfProfileIn( $fname.'-misc1' ); |
| 289 | +wfProfileOut( $fname . '-includes' ); |
| 290 | +wfProfileIn( $fname . '-misc1' ); |
289 | 291 | |
290 | 292 | # Raise the memory limit if it's too low |
291 | 293 | wfMemoryLimit(); |
— | — | @@ -339,8 +341,8 @@ |
340 | 342 | } |
341 | 343 | } |
342 | 344 | |
343 | | -wfProfileOut( $fname.'-misc1' ); |
344 | | -wfProfileIn( $fname.'-memcached' ); |
| 345 | +wfProfileOut( $fname . '-misc1' ); |
| 346 | +wfProfileIn( $fname . '-memcached' ); |
345 | 347 | |
346 | 348 | $wgMemc =& wfGetMainCache(); |
347 | 349 | $messageMemc =& wfGetMessageCacheStorage(); |
— | — | @@ -350,20 +352,20 @@ |
351 | 353 | get_class( $messageMemc ) . '[message] ' . |
352 | 354 | get_class( $parserMemc ) . "[parser]\n" ); |
353 | 355 | |
354 | | -wfProfileOut( $fname.'-memcached' ); |
| 356 | +wfProfileOut( $fname . '-memcached' ); |
355 | 357 | |
356 | | -## Most of the config is out, some might want to run hooks here. |
| 358 | +# # Most of the config is out, some might want to run hooks here. |
357 | 359 | wfRunHooks( 'SetupAfterCache' ); |
358 | 360 | |
359 | | -wfProfileIn( $fname.'-session' ); |
| 361 | +wfProfileIn( $fname . '-session' ); |
360 | 362 | |
361 | 363 | # If session.auto_start is there, we can't touch session name |
362 | 364 | if ( !wfIniGetBool( 'session.auto_start' ) ) { |
363 | 365 | session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); |
364 | 366 | } |
365 | 367 | |
366 | | -if( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { |
367 | | - if( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) { |
| 368 | +if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { |
| 369 | + if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) { |
368 | 370 | wfIncrStats( 'request_with_session' ); |
369 | 371 | wfSetupSession(); |
370 | 372 | $wgSessionStarted = true; |
— | — | @@ -373,8 +375,8 @@ |
374 | 376 | } |
375 | 377 | } |
376 | 378 | |
377 | | -wfProfileOut( $fname.'-session' ); |
378 | | -wfProfileIn( $fname.'-globals' ); |
| 379 | +wfProfileOut( $fname . '-session' ); |
| 380 | +wfProfileIn( $fname . '-globals' ); |
379 | 381 | |
380 | 382 | $wgContLang = new StubContLang; |
381 | 383 | |
— | — | @@ -388,7 +390,7 @@ |
389 | 391 | $wgMessageCache = new StubObject( 'wgMessageCache', 'MessageCache', |
390 | 392 | array( $messageMemc, $wgUseDatabaseMessages, $wgMsgCacheExpiry ) ); |
391 | 393 | |
392 | | -if( !is_object( $wgAuth ) ) { |
| 394 | +if ( !is_object( $wgAuth ) ) { |
393 | 395 | $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' ); |
394 | 396 | wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) ); |
395 | 397 | } |
— | — | @@ -399,8 +401,8 @@ |
400 | 402 | |
401 | 403 | $wgDeferredUpdateList = array(); |
402 | 404 | |
403 | | -wfProfileOut( $fname.'-globals' ); |
404 | | -wfProfileIn( $fname.'-extensions' ); |
| 405 | +wfProfileOut( $fname . '-globals' ); |
| 406 | +wfProfileIn( $fname . '-extensions' ); |
405 | 407 | |
406 | 408 | # Skin setup functions |
407 | 409 | # Entries can be added to this variable during the inclusion |
— | — | @@ -416,14 +418,14 @@ |
417 | 419 | foreach ( $wgExtensionFunctions as $func ) { |
418 | 420 | # Allow closures in PHP 5.3+ |
419 | 421 | if ( is_object( $func ) && $func instanceof Closure ) { |
420 | | - $profName = $fname.'-extensions-closure'; |
421 | | - } elseif( is_array( $func ) ) { |
| 422 | + $profName = $fname . '-extensions-closure'; |
| 423 | + } elseif ( is_array( $func ) ) { |
422 | 424 | if ( is_object( $func[0] ) ) |
423 | | - $profName = $fname.'-extensions-'.get_class( $func[0] ).'::'.$func[1]; |
| 425 | + $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1]; |
424 | 426 | else |
425 | | - $profName = $fname.'-extensions-'.implode( '::', $func ); |
| 427 | + $profName = $fname . '-extensions-' . implode( '::', $func ); |
426 | 428 | } else { |
427 | | - $profName = $fname.'-extensions-'.strval( $func ); |
| 429 | + $profName = $fname . '-extensions-' . strval( $func ); |
428 | 430 | } |
429 | 431 | |
430 | 432 | wfProfileIn( $profName ); |
— | — | @@ -439,5 +441,5 @@ |
440 | 442 | |
441 | 443 | wfDebug( "Fully initialised\n" ); |
442 | 444 | $wgFullyInitialised = true; |
443 | | -wfProfileOut( $fname.'-extensions' ); |
| 445 | +wfProfileOut( $fname . '-extensions' ); |
444 | 446 | wfProfileOut( $fname ); |