2

I'm asking as I'm using packages like im0rtality/jsonstreamingparser that depend on the input being a native php stream, e.g. by calling get_resource_type().

If not directly, is there any wrapper library on packagist that my search did not turn up?

andig
  • 13,378
  • 13
  • 61
  • 98
  • Did you take a look for example at Zend\Diactoros? Its stream class, implementing StreamInterface, seems to do what you're looking for (https://github.com/zendframework/zend-diactoros/blob/master/src/Stream.php) – marcosh Sep 14 '15 at 14:11
  • imho Diactoros is the other way round- expose a stream as StreamInterface? – andig Sep 14 '15 at 16:04
  • yes, you're right, I didn't understand correctly your question – marcosh Sep 14 '15 at 16:11

1 Answers1

4

guzzle/psr7 provides the desired funtionality by its StreamWrapper class: https://github.com/guzzle/psr7/blob/master/src/StreamWrapper.php

andig
  • 13,378
  • 13
  • 61
  • 98