On Tue, Jun 21, 2016 at 2:28 PM, Alexander Moskalev <ir...@irker.net> wrote:

> Thank you!
>
> 2016-06-21 23:31 GMT+03:00 Davey Shafik <da...@php.net>:
>
>> you can use a memory stream
>
> I thought about something like that. But if we created memory stream
> (php://memory ?), we have file pointer resource related to this stream. And
> we cannot read or write something in this stream without such file pointer
> provided.
>
> Example code:
>>
>> $fp = fopen("php://memory", 'r+');
>> fputs($fp, "foo\n");
>> rewind($fp);
>> echo file_get_contents("php://memory"); // <- this doesn't work, and same
>> will be in curl.
>> echo stream_get_contents($fp); //<- this will work
>
>
>
> Or you mean something else?
>

In this one case, you would be _required_ to pass in the stream handle in.
All other cases would work with either the resource URL (e.g. s3://<path>)
or a stream handle.

- Davey

Reply via email to