Skip to content

Commit 31efd6f

Browse files
committed
Add docs
1 parent 96c4dd0 commit 31efd6f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ $stream->close();
5656

5757
The following streams are available by default:
5858

59+
### CliStream
60+
61+
Can be used to open up CLI `stdin`, `stdout` and `stderr` streams.
62+
63+
```php
64+
use Phpro\ResourceStream\Factory\CliStream;
65+
66+
$stdin = CliStream::stdin();
67+
$stdout = CliStream::stdout();
68+
$stderr = CliStream::stderr();
69+
```
70+
5971
### FileStream
6072

6173
Validates if the local file exists and opens it up for you to use.
@@ -66,6 +78,17 @@ use Phpro\ResourceStream\Factory\FileStream;
6678
$stream = FileStream::create('/path/to/file', FileStream::READ_WRITE_MODE);
6779
```
6880

81+
### IOStream
82+
83+
Can be used to open up CGI `php://input` and `php://output` streams.
84+
85+
```php
86+
use Phpro\ResourceStream\Factory\IOStream;
87+
88+
$input = IOStream::input();
89+
$output = IOStream::output();
90+
```
91+
6992
### MemoryStream
7093

7194
Creates an in-memory stream for you to use.

0 commit comments

Comments
 (0)