Giter VIP home page Giter VIP logo

Comments (4)

Slamdunk avatar Slamdunk commented on May 20, 2024

Hi, may I ask what's your use case?

from openspout.

darthf1 avatar darthf1 commented on May 20, 2024

Yes ofcourse,

My filesystem is abstracted using Flysystem and I'm making heavy usage of FilesystemReader::readStream and FilesystemWriter::writeStream methods.

If the reader supports streams, I can pass the result of FilesystemReader::readStream directly without additional writes to disk, and vice versa for the writer.

Also, not the least, with Flysystem I can only get the contents of the file and not the path to the file since files do not need to "live" on the current filesystem.

from openspout.

Slamdunk avatar Slamdunk commented on May 20, 2024

Regarding the Writer, although it should be possible to write to a user-provided stream, it wouldn't work as you expect with Flysystem: FilesystemWriter::writeStream expects an already filled stream, you cannot pass to it a stream that still needs to receive the data. So at least a php://memory intermediate stream would be needed anyway and in my experience that's more of a burden rather than an help.

Regarding the Reader, only the CSV one could achieve your goal as both ODS and XLSX rely on ZipStream::open which doesn't accept a stream.
And I don't like very much to add a feature so specific to a single component.

I have a decent experience with Flysystem, streams and filesystem operations on PHP, and although bypassing the disk entirely seems good in theory I strongly suggest you to rely on physical temporary files for intermediate steps, you'll save yourself a lot of pita.

from openspout.

darthf1 avatar darthf1 commented on May 20, 2024

And I don't like very much to add a feature so specific to a single component.

I fully agree. It should only be done if possible for all formats.

Thank you for your reply and your advice. I'll close this request for now.

from openspout.

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.