Index: trunk/phase3/maintenance/refreshLinks.inc |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | #define( "REPORTING_INTERVAL", 1 ); |
11 | 11 | |
12 | 12 | function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $redirectsOnly = false, $oldRedirectsOnly = false ) { |
13 | | - global $wgUser, $wgParser, $wgUseImageResize, $wgUseTidy; |
| 13 | + global $wgUser, $wgParser, $wgUseTidy; |
14 | 14 | |
15 | 15 | $fname = 'refreshLinks'; |
16 | 16 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -21,8 +21,7 @@ |
22 | 22 | # Don't generate extension images (e.g. Timeline) |
23 | 23 | $wgParser->clearTagHooks(); |
24 | 24 | |
25 | | - # Don't generate thumbnail images |
26 | | - $wgUseImageResize = false; |
| 25 | + # Don't use HTML tidy |
27 | 26 | $wgUseTidy = false; |
28 | 27 | |
29 | 28 | $what = $redirectsOnly ? "redirects" : "links"; |
Index: trunk/phase3/maintenance/eval.php |
— | — | @@ -15,12 +15,7 @@ |
16 | 16 | * @addtogroup Maintenance |
17 | 17 | */ |
18 | 18 | |
19 | | -$wgForceLoadBalancing = (getenv('MW_BALANCE') ? true : false); |
20 | | -$wgUseNormalUser = (getenv('MW_WIKIUSER') ? true : false); |
21 | | -if (getenv('MW_PROFILING')) { |
22 | | - define('MW_CMDLINE_CALLBACK', 'wfSetProfiling'); |
23 | | -} |
24 | | -function wfSetProfiling() { $GLOBALS['wgProfiling'] = true; } |
| 19 | +$wgUseNormalUser = (bool)getenv('MW_WIKIUSER'); |
25 | 20 | |
26 | 21 | $optionsWithArgs = array( 'd' ); |
27 | 22 | |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -255,29 +255,30 @@ |
256 | 256 | */ |
257 | 257 | function wfLogProfilingData() { |
258 | 258 | global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest; |
259 | | - global $wgProfiling, $wgUser; |
260 | | - if ( $wgProfiling ) { |
261 | | - $now = wfTime(); |
262 | | - $elapsed = $now - $wgRequestTime; |
263 | | - $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed ); |
264 | | - $forward = ''; |
265 | | - if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) |
266 | | - $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR']; |
267 | | - if( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) |
268 | | - $forward .= ' client IP ' . $_SERVER['HTTP_CLIENT_IP']; |
269 | | - if( !empty( $_SERVER['HTTP_FROM'] ) ) |
270 | | - $forward .= ' from ' . $_SERVER['HTTP_FROM']; |
271 | | - if( $forward ) |
272 | | - $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})"; |
273 | | - // Don't unstub $wgUser at this late stage just for statistics purposes |
274 | | - if( StubObject::isRealObject($wgUser) && $wgUser->isAnon() ) |
275 | | - $forward .= ' anon'; |
276 | | - $log = sprintf( "%s\t%04.3f\t%s\n", |
277 | | - gmdate( 'YmdHis' ), $elapsed, |
278 | | - urldecode( $wgRequest->getRequestURL() . $forward ) ); |
279 | | - if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) { |
280 | | - wfErrorLog( $log . $prof, $wgDebugLogFile ); |
281 | | - } |
| 259 | + global $wgProfiler, $wgUser; |
| 260 | + if ( !isset( $wgProfiler ) ) |
| 261 | + return; |
| 262 | + |
| 263 | + $now = wfTime(); |
| 264 | + $elapsed = $now - $wgRequestTime; |
| 265 | + $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed ); |
| 266 | + $forward = ''; |
| 267 | + if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) |
| 268 | + $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR']; |
| 269 | + if( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) |
| 270 | + $forward .= ' client IP ' . $_SERVER['HTTP_CLIENT_IP']; |
| 271 | + if( !empty( $_SERVER['HTTP_FROM'] ) ) |
| 272 | + $forward .= ' from ' . $_SERVER['HTTP_FROM']; |
| 273 | + if( $forward ) |
| 274 | + $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})"; |
| 275 | + // Don't unstub $wgUser at this late stage just for statistics purposes |
| 276 | + if( StubObject::isRealObject($wgUser) && $wgUser->isAnon() ) |
| 277 | + $forward .= ' anon'; |
| 278 | + $log = sprintf( "%s\t%04.3f\t%s\n", |
| 279 | + gmdate( 'YmdHis' ), $elapsed, |
| 280 | + urldecode( $wgRequest->getRequestURL() . $forward ) ); |
| 281 | + if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) { |
| 282 | + wfErrorLog( $log . $prof, $wgDebugLogFile ); |
282 | 283 | } |
283 | 284 | } |
284 | 285 | |
Index: trunk/phase3/includes/Database.php |
— | — | @@ -447,10 +447,10 @@ |
448 | 448 | * @throws DBQueryError Thrown when the database returns an error of any kind |
449 | 449 | */ |
450 | 450 | public function query( $sql, $fname = '', $tempIgnore = false ) { |
451 | | - global $wgProfiling; |
| 451 | + global $wgProfiler; |
452 | 452 | |
453 | 453 | $isMaster = !is_null( $this->getLBInfo( 'master' ) ); |
454 | | - if ( $wgProfiling ) { |
| 454 | + if ( isset( $wgProfiler ) ) { |
455 | 455 | # generalizeSQL will probably cut down the query to reasonable |
456 | 456 | # logging size most of the time. The substr is really just a sanity check. |
457 | 457 | |
— | — | @@ -533,7 +533,7 @@ |
534 | 534 | $this->reportQueryError( $this->lastError(), $this->lastErrno(), $sql, $fname, $tempIgnore ); |
535 | 535 | } |
536 | 536 | |
537 | | - if ( $wgProfiling ) { |
| 537 | + if ( isset( $wgProfiler ) ) { |
538 | 538 | wfProfileOut( $queryProf ); |
539 | 539 | wfProfileOut( $totalProf ); |
540 | 540 | } |
Index: trunk/phase3/includes/LinkCache.php |
— | — | @@ -110,8 +110,8 @@ |
111 | 111 | if ( 0 != $id ) { return $id; } |
112 | 112 | |
113 | 113 | $fname = 'LinkCache::addLinkObj'; |
114 | | - global $wgProfiling, $wgProfiler; |
115 | | - if ( $wgProfiling && isset( $wgProfiler ) ) { |
| 114 | + global $wgProfiler; |
| 115 | + if ( isset( $wgProfiler ) ) { |
116 | 116 | $fname .= ' (' . $wgProfiler->getCurrentSection() . ')'; |
117 | 117 | } |
118 | 118 | |