Allows an existing stream object in PHP to be accessed by URL.
This is useful to pass a stream as an input to a PHP API that only accepts URIs for its inputs, such as XMLReader.
StreamStream is implemented as a stream wrapper that reads from another underlying stream.
require_once 'StreamStream.php'
// Open a stream
$stream = fopen('http://en.blog.wordpress.com/feed/', 'rb');
// Create a URI for the stream
$streamUri = StreamStream::createUriForStream($stream);
// Pass the URI to another API
$xmlReader = new XMLReader();
$xmlReader->open($streamUri);
- PHP 5.2.11 or later
This code is licensed under the Apache License 2.0. Details can be found in the file LICENSE.txt.