PHP code example of stadly / file-waiter

1. Go to this page and download the library: Download stadly/file-waiter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stadly / file-waiter example snippets

 php
$request = new \GuzzleHttp\Psr7\ServerRequest('GET', '');           // Any PSR-7 compatible server request.
$request = $request->withHeader('If-None-Match', '"foo"');

$response = $waiter->handle($request);                              // 304 Not Modified if the file's entity tag is "foo".
 php
$request = new \GuzzleHttp\Psr7\ServerRequest('GET', '');           // Any PSR-7 compatible server request.
$request = $request->withHeader('Range', 'bytes=10-20');

$response = $waiter->handle($request);                              // Response contains only the requested bytes.