Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -504,11 +504,43 @@ |
505 | 505 | } else { |
506 | 506 | $msg .= "\n<p>Backtrace:</p>\n$backtrace"; |
507 | 507 | } |
508 | | - } |
509 | | - echo $msg; |
510 | | - die( -1 ); |
| 508 | + } |
| 509 | + echo $msg; |
| 510 | + echo wfReportTime(); |
| 511 | + die( -1 ); |
511 | 512 | } |
512 | 513 | |
| 514 | + /** |
| 515 | + * Returns a HTML comment with the elapsed time since request. |
| 516 | + * This method has no side effects. |
| 517 | + * @return string |
| 518 | + */ |
| 519 | + function wfReportTime() { |
| 520 | + global $wgRequestTime; |
| 521 | + |
| 522 | + $now = wfTime(); |
| 523 | + list( $usec, $sec ) = explode( ' ', $wgRequestTime ); |
| 524 | + $start = (float)$sec + (float)$usec; |
| 525 | + $elapsed = $now - $start; |
| 526 | + |
| 527 | + # Use real server name if available, so we know which machine |
| 528 | + # in a server farm generated the current page. |
| 529 | + if ( function_exists( 'posix_uname' ) ) { |
| 530 | + $uname = @posix_uname(); |
| 531 | + } else { |
| 532 | + $uname = false; |
| 533 | + } |
| 534 | + if( is_array( $uname ) && isset( $uname['nodename'] ) ) { |
| 535 | + $hostname = $uname['nodename']; |
| 536 | + } else { |
| 537 | + # This may be a virtual server. |
| 538 | + $hostname = $_SERVER['SERVER_NAME']; |
| 539 | + } |
| 540 | + $com = sprintf( "<!-- Served by %s in %01.2f secs. -->", |
| 541 | + $hostname, $elapsed ); |
| 542 | + return $com; |
| 543 | + } |
| 544 | + |
513 | 545 | function wfBacktrace() { |
514 | 546 | global $wgCommandLineMode; |
515 | 547 | if ( !function_exists( 'debug_backtrace' ) ) { |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -505,32 +505,13 @@ |
506 | 506 | /** |
507 | 507 | * Returns a HTML comment with the elapsed time since request. |
508 | 508 | * This method has no side effects. |
| 509 | + * Use wfReportTime() instead. |
509 | 510 | * @return string |
| 511 | + * @deprecated |
510 | 512 | */ |
511 | 513 | function reportTime() { |
512 | | - global $wgRequestTime; |
513 | | - |
514 | | - $now = wfTime(); |
515 | | - list( $usec, $sec ) = explode( ' ', $wgRequestTime ); |
516 | | - $start = (float)$sec + (float)$usec; |
517 | | - $elapsed = $now - $start; |
518 | | - |
519 | | - # Use real server name if available, so we know which machine |
520 | | - # in a server farm generated the current page. |
521 | | - if ( function_exists( 'posix_uname' ) ) { |
522 | | - $uname = @posix_uname(); |
523 | | - } else { |
524 | | - $uname = false; |
525 | | - } |
526 | | - if( is_array( $uname ) && isset( $uname['nodename'] ) ) { |
527 | | - $hostname = $uname['nodename']; |
528 | | - } else { |
529 | | - # This may be a virtual server. |
530 | | - $hostname = $_SERVER['SERVER_NAME']; |
531 | | - } |
532 | | - $com = sprintf( "<!-- Served by %s in %01.2f secs. -->", |
533 | | - $hostname, $elapsed ); |
534 | | - return $com; |
| 514 | + $time = wfReportTime(); |
| 515 | + return $time; |
535 | 516 | } |
536 | 517 | |
537 | 518 | /** |