https://github.com/davidfstr/streamstream
Access PHP stream objects by URL.
https://github.com/davidfstr/streamstream
Last synced: 4 months ago
JSON representation
Access PHP stream objects by URL.
- Host: GitHub
- URL: https://github.com/davidfstr/streamstream
- Owner: davidfstr
- License: apache-2.0
- Created: 2012-08-08T22:26:41.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-02-20T05:43:59.000Z (over 12 years ago)
- Last Synced: 2025-02-24T03:36:39.000Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 102 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# StreamStream
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.
[XMLReader]: http://php.net/manual/en/book.xmlreader.php
## Example
```
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);
```## Requirements
* PHP 5.2.11 or later
## License
This code is licensed under the Apache License 2.0. Details can be found in the file [LICENSE.txt].
[LICENSE.txt]: https://github.com/davidfstr/StreamStream/blob/master/LICENSE.txt