From 3cb78ca914e437e83d3f109c306a113318a8b6ef Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 25 Feb 2012 00:53:56 +0000 Subject: [PATCH] Added some StreamFile profiling --- includes/StreamFile.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/StreamFile.php b/includes/StreamFile.php index ce13a21f42..1b4b6aaf0b 100644 --- a/includes/StreamFile.php +++ b/includes/StreamFile.php @@ -19,18 +19,23 @@ class StreamFile { * @return bool Success */ public static function stream( $fname, $headers = array(), $sendErrors = true ) { + wfProfileIn( __METHOD__ ); + wfSuppressWarnings(); $stat = stat( $fname ); wfRestoreWarnings(); $res = self::prepareForStream( $fname, $stat, $headers, $sendErrors ); if ( $res == self::NOT_MODIFIED ) { - return true; // use client cache + $ok = true; // use client cache } elseif ( $res == self::READY_STREAM ) { - return readfile( $fname ); + $ok = readfile( $fname ); } else { - return false; // failed + $ok = false; // failed } + + wfProfileOut( __METHOD__ ); + return $ok; } /** -- 2.20.1