r112378 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112377‎ | r112378 | r112379 >
Date:00:53, 25 February 2012
Author:aaron
Status:ok
Tags:
Comment:
Added some StreamFile profiling
Modified paths:
  • /trunk/phase3/includes/StreamFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/StreamFile.php
@@ -19,18 +19,23 @@
2020 * @return bool Success
2121 */
2222 public static function stream( $fname, $headers = array(), $sendErrors = true ) {
 23+ wfProfileIn( __METHOD__ );
 24+
2325 wfSuppressWarnings();
2426 $stat = stat( $fname );
2527 wfRestoreWarnings();
2628
2729 $res = self::prepareForStream( $fname, $stat, $headers, $sendErrors );
2830 if ( $res == self::NOT_MODIFIED ) {
29 - return true; // use client cache
 31+ $ok = true; // use client cache
3032 } elseif ( $res == self::READY_STREAM ) {
31 - return readfile( $fname );
 33+ $ok = readfile( $fname );
3234 } else {
33 - return false; // failed
 35+ $ok = false; // failed
3436 }
 37+
 38+ wfProfileOut( __METHOD__ );
 39+ return $ok;
3540 }
3641
3742 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r112379MFT r112378aaron01:00, 25 February 2012

Status & tagging log