Giter VIP home page Giter VIP logo

resume's Introduction

Resume

Build Status Scrutinizer Code Quality Code Coverage License

A lightweight, extensible library for processing content ranges and partial resource requests in PHP

Installation

composer require daverandom/resume

Usage

See examples directory

TODO

  • Write more tests
  • Write more examples
  • Write proper docs
  • Maintain until one of us dies

resume's People

Contributors

daverandom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

resume's Issues

Can't understand this library

Thank you so much for all the work you put into this library. However, I can't find the code that actually returns the file to the user, and I can't understand the example code that calls the library. I wanted to write my own simpler function, using your library to learn from, but I don't have the patience to read through all the code to understand it. I apologize for my lack of patience, but I'll look elsewhere to try to understand this "range" business. I've written a function that sends the file in chunks, but it doesn't allow the user to reposition the video and it only works on Firefox, not on Chrome, due to lack of "range".

Editorial: it is strange that some everyday operations, like doing insecure FTP, is easy to do based on just the PHP Manual, yet other operations, like doing secure FTP or providing the user with a video file, are hairy and not explained in the Manual.

PHP 7.1 or 5.4?

Hi Chris Wright,

I came here from your StackOverflow post, which mentions that your code runs on PHP 5.4 or later:
https://stackoverflow.com/questions/157318/resumable-downloads-when-using-php-to-send-the-file/4451376#4451376
However, the composer.json in this repository requires PHP 7.1 or later. I'm unfortunately stuck at PHP 7.0 at the moment, and I was wondering:

  • whether the required version is PHP 5.4 or 7.1
  • and if it does require PHP 7.1, what functionality from 7.1 is used. I only noticed a few nullable types and class constant visibility.

Thank you in advance,

Koen

Unable to set a custom filename

It would be good if we could set a custom filename rather than relying on the filename of the file being served. In my case, the file to be served has a filename of random characters but I'd like to serve the file with a "friendly" name.

How do we set additional headers?

Looking at the code and examples and I can't see how I could set additional headers for cache control. It's not possible to extend the Servlet class and overwrite the default headers method as the class is final.

getting php error on closing of download

I'm using your class to resume an audio stream. When I close the stream, cancelling the running download, I get the following error:
PHP Fatal error: Uncaught TypeError: fclose() expects parameter 1 to be resource, int given in [....]vendor/daverandom/resume/src/FileResource.php:114
I'm running PHP 7.4.16. Did I implement your class wrong or is this something that shouldn't happen?
Thanks for your amazing work on this!

Wrong Content-Length?

Hi!
As far as i can see, the full filesize is always returned as Content-length. I think this is not completely compliant with the definition of 206 Partial Content (rfc7233). or am i wrong?

 HTTP/1.1 206 Partial Content
 Date: Thu, 05 Apr 2018 21:26:15 GMT
 Server: Apache/2.4.27 (Win64) OpenSSL/1.1.0f PHP/7.1.9
 X-Powered-By: PHP/7.1.9
 Content-Length: 1000 // currently in each response constant
 accept-ranges: bytes
 Content-Range: bytes 445-999/1000
 Content-Type: video/x-matroska
 
 ... followed by 555 bytes of partial data ...

shouldn't it be in this example:
Content-Length: 555
Which means it has to be calculated individually for each response and range?

No support for at least PHP 5.4

Hi I am using this beautiful library and i though that this is just awesome but it would be better it this supports 5.4 as a minimum requirement.
Currently i ll be using php version to determine weather i ll use this or other classes for pp versions.
Thanks

What is this autoload.php?

Thank you for this useful library, which I haven't tried yet.

Don't understand the example code require __DIR__ . '/../vendor/autoload.php';. What is this autoload.php? Is it necessary? What does it do? Where is this code? Where is it called? Who is the 'vendor'? Where is it documented? Why no comment in the example code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.