OutputHandler: Omit debug() call for common case
Folllows-up I4c2d478b492ff17. * MW_ENTRY_POINT can only be undefined in very early WebStart/Setup code. In code outside those files, and by the time MW_SETUP_CALLBACK OutputHandler run, this is always filled in to at least "unknown". * Inline extra code to the less common conditional block. Bug: T290776 Change-Id: Ia7fa6cb0ff156ed6cb0212443ac3a97c91982d4b
This commit is contained in:
parent
64a4d6e74f
commit
faf2233cf4
1 changed files with 6 additions and 8 deletions
|
|
@ -41,13 +41,13 @@ class OutputHandler {
|
|||
public static function handle( $s, $phase ) {
|
||||
global $wgDisableOutputCompression, $wgMangleFlashPolicy;
|
||||
|
||||
$logger = LoggerFactory::getInstance( 'output' );
|
||||
$entry = defined( 'MW_ENTRY_POINT' ) ? MW_ENTRY_POINT : 'unknown';
|
||||
$size = strlen( $s );
|
||||
|
||||
// Don't send headers if output is being discarded (T278579)
|
||||
if ( ( $phase & PHP_OUTPUT_HANDLER_CLEAN ) === PHP_OUTPUT_HANDLER_CLEAN ) {
|
||||
// Don't send headers if output is being discarded (T278579)
|
||||
$logger->debug( __METHOD__ . " entrypoint=$entry; size=$size; phase=$phase" );
|
||||
$logger = LoggerFactory::getInstance( 'output' );
|
||||
$logger->debug( __METHOD__ . " entrypoint={entry}; size={size}; phase=$phase", [
|
||||
'entry' => MW_ENTRY_POINT,
|
||||
'size' => strlen( $s ),
|
||||
] );
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
|
@ -88,8 +88,6 @@ class OutputHandler {
|
|||
self::emitContentLength( strlen( $s ) );
|
||||
}
|
||||
|
||||
$logger->debug( __METHOD__ . " entrypoint=$entry; size=$size; phase=$phase" );
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue