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/