Skip to content

Commit 3e31cde

Browse files
committed
:octocat:
1 parent 3e002db commit 3e31cde

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,18 @@ The following classes contain static methods for use with PSR-7 http message obj
9696
| `getFromContent(string $content)` | `?string` | Get the mime type from the given content |
9797

9898
### `StreamUtil`
99-
| method | return | info |
100-
|----------------------------------|----------|---------------------------------------------------------|
101-
| `getContents(string $extension)` | `string` | Reads the content from a stream and make sure we rewind |
99+
| method | return | info |
100+
|----------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
101+
| `getContents(string $extension)` | `string` | Reads the content from a stream and make sure we rewind |
102+
| `copyToStream(StreamInterface $source, StreamInterface $destination, int $maxLength = null)` | `int` | Copies a stream to another stream, starting from the current position of the source stream, reading to the end or until the given maxlength is hit. |
103+
| `tryFopen(string $filename, string $mode, $context = null)` | `resource` | Safely open a PHP resource, throws instead of raising warnings and errors |
104+
| `tryGetContents($stream, int $length = null, int $offset = -1)` | `string` | Safely get the contents of a stream resource, throws instead of raising warnings and errors |
105+
| `validateMode(string $mode)` | `string` | Checks if the given mode is valid for `fopen()` |
106+
| `modeAllowsReadWrite(string $mode)` | `bool` | Checks whether the given mode allows reading and writing |
107+
| `modeAllowsReadOnly(string $mode)` | `bool` | Checks whether the given mode allows only reading |
108+
| `modeAllowsWriteOnly(string $mode)` | `bool` | Checks whether the given mode allows only writing |
109+
| `modeAllowsRead(string $mode)` | `bool` | Checks whether the given mode allows reading |
110+
| `modeAllowsWrite(string $mode)` | `bool` | Checks whether the given mode allows writing |
102111

103112
### `ServerUtil`
104113
The `ServerUtil` object requires a set of [PSR-17 factories](https://www.php-fig.org/psr/psr-17/) on invocation, namely `ServerRequestFactoryInterface`, `UriFactoryInterface`, `UploadedFileFactoryInterface` and `StreamFactoryInterface`.

0 commit comments

Comments
 (0)