Code Monkey home page Code Monkey logo

Comments (2)

jhammer avatar jhammer commented on June 3, 2024

Thanks for the reply! Two thoughts:

  1. I agree that your proposed addFilesFromZip… method is a better design.
  2. I had not considered looping over ZipArchive because I didn’t think there was a way to read the raw stream and write it to ZipStream without the overhead of decompressing/recompressing. However, your suggestion prompted me to look again. It seems like ZipArchive can provide the raw stream. If ZipStream provided API to add a file using a raw stream (i.e. to avoid decompressing/recompressing), I think that would suffice.

from zipstream-php.

maennchen avatar maennchen commented on June 3, 2024

@jhammer

Good point about accessing the raw stream. Where did you see that it supports that? If not, this approach would mean that a compressed file would be uncompressed and recompressed when adding it. I don't think that would fulfill your need, right?

Probably a better way would be to just read the zip file from a stream and just forward all file headers / contents & record their position. As soon as the end of central directory header is reached, the entries need to be parsed, the location rewritten and then we continue as normal.

I would be both open to support someone developing this feature and receive a PR or also to implement it myself provided somebody sponsors my time. If you're interested in that, send me an email for the details. (Email is public in my profile)

from zipstream-php.

Related Issues (20)

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.