From d919552a3ef55da6f2b67d5eab863149fa01286f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 30 Mar 2015 11:23:38 +0000 Subject: [PATCH] complete rearrangement an splitting into functions --- src/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.php b/src/index.php index 1198bd8..cbde706 100644 --- a/src/index.php +++ b/src/index.php @@ -77,7 +77,7 @@ function source($dir, $file, $mime=NULL) { } /** Output only a part of a file */ -function range($path, $size, $mime) { +function fileRange($path, $size, $mime) { $ranges = array_map('intval', // Parse the parts into integer explode('-', // The range separator // Skip the `bytes=` part of the header @@ -121,7 +121,7 @@ function output($path) { @ini_set('zlib.output_compression', 'Off'); header('Content-type: ' . $mime); if (isset($_SERVER['HTTP_RANGE'])) { - range($path, $size, $mime); + fileRange($path, $size, $mime); } else { header('Content-Length: ' . $size); @readfile($file);