Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.53 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.53 KB

lochmueller/http-range

Latest Stable Version Total Downloads License Percentage of issues still open PHPStan

Use PSR-7 messages and a PSR-15 handler/middleware to handle HTTP Range request and trigger valid partial download for streams/files. Hande multiple ranges and check different env requirements.

Usage

use Lochmueller\HttpRange\HttpRangeRequestHandler;
use Lochmueller\HttpRange\Stream\ReadLocalFileStream;

$handler = new HttpRangeRequestHandler(new ReadLocalFileStream($filePath));
$response = $handler->handle($serverRequest);
// Use response header and content

// or via middleware - HttpRangeMiddleware::class
// response is used for the range split

Tests

Run composer test to execute the current tests suite or run composer code-fix to format the code in dev context.

Problems