Proposal: php://memory/<id> (& ://temp/<id>)

From: Date: Thu, 31 Jan 2013 09:37:53 +0000
Subject: Proposal: php://memory/<id> (& ://temp/<id>)
Groups: php.internals 
Request: Send a blank email to internals+get-65528@lists.php.net to get a copy of this message
Hi internals, The php://memory, and its respectful sibling php://temp, appear very useful when we need to compute streams on-the-fly. They offer a lot of services, like avoiding HDD accesses, increasing speed... and through a straightforward API /à la/ PHP, e.g. fopen('php://memory', 'r+'). However, we always work on the same "bucket"/space of data (per runtime), which prevent us to use two different streams at a time. My proposal is to allow access to many "buckets"/spaces to php://memory and its sibling. I propose the following syntax:
    php://memory/<id>
    php://temp/<id>/maxmemory:<size>
We append /<id> to the existing syntax. Thus, it would be possible to work on php://memory/foo and php://memory/bar without collisions between them. They would represent two distinct "buckets"/spaces. The implementation does not seem to require a ton of work, and the use cases are numerous regarding the services offered by these wrappers. Thoughts? Best regards. -- Ivan Enderlin Developer of Hoa http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/

« previous php.internals (#65528) next »