From: Aaron Schulz Date: Sat, 25 Feb 2012 00:53:56 +0000 (+0000) Subject: Added some StreamFile profiling X-Git-Tag: 1.31.0-rc.0~24524 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=3cb78ca914e437e83d3f109c306a113318a8b6ef;p=lhc%2Fweb%2Fwiklou.git Added some StreamFile profiling --- 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; } /**