X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=3b7ff43612bee0a80ca5c1055c242b38f9c795a0;hb=a2400af787d3fff706c5301833965d9f676aa3ed;hp=0d0a15ebcfed1ba1222b8760f63375e884143c2e;hpb=958b8f14946667181aa68060f8a56e704b020223;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 0d0a15ebcf..3b7ff43612 100644 --- a/thumb.php +++ b/thumb.php @@ -298,8 +298,6 @@ function wfStreamThumb( array $params ) { $headers[] = 'Vary: ' . implode( ', ', $varyHeader ); } - $stats = RequestContext::getMain()->getStats(); - // Stream the file if it exists already... $thumbPath = $img->getThumbPath( $thumbName ); if ( $img->getRepo()->fileExists( $thumbPath ) ) { @@ -310,7 +308,8 @@ function wfStreamThumb( array $params ) { if ( !$success ) { wfThumbError( 500, 'Could not stream the file' ); } else { - $stats->timing( 'media.thumbnail.stream', $streamtime ); + RequestContext::getMain()->getStats()->timing( 'media.thumbnail.stream', $streamtime ); + wfDebugLog( 'thumbnailaccess', time() . ' ' . $thumbPath . ' ' . ob_get_length() . ' Streamed ' ); } return; } @@ -324,10 +323,8 @@ function wfStreamThumb( array $params ) { return; } - // Actually generate a new thumbnail - $starttime = microtime( true ); list( $thumb, $errorMsg ) = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath ); - $generatetime = microtime( true ) - $starttime; + /** @var MediaTransformOutput|bool $thumb */ // Check for thumbnail generation errors... @@ -348,8 +345,6 @@ function wfStreamThumb( array $params ) { if ( $errorMsg !== false ) { wfThumbError( $errorCode, $errorMsg ); } else { - $stats->timing( 'media.thumbnail.generate', $generatetime ); - // Stream the file if there were no errors $success = $thumb->streamFile( $headers ); if ( !$success ) {