lochmueller / http-range

Use PSR-7 messages and a PSR-15 to handle HTTP Range valid partial download requests to files. Hande multiple ranges and check different env requirements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Use PSR-7 messages and a PSR-15 to handle HTTP Range valid partial download requests to files. Hande multiple ranges and check different env requirements.

License:MIT License


Languages

Language:PHP 100.0%