StreamWrapper
final class StreamWrapper
Adapt Guzzle's PSR-7 resource bridge so stream callers retain cancellation failures.
Constants
| PROTOCOL |
|
Properties
| resource | $context |
Methods
Return a borrowed resource without taking ownership of the underlying stream.
Transfer ownership of a stream to a PHP resource.
Create a stream context for a borrowed PHP stream resource.
Register the stream wrapper protocol once per process.
Open the PSR-7 stream supplied through its resource context.
Close an owned stream while leaving borrowed bodies with their owner.
Read bytes while preserving cancellation through producer cleanup.
Write bytes to the underlying stream.
Accept flushing for a PSR-7 stream without a separate flush operation.
Return the current stream position.
Determine whether the underlying stream has ended.
Seek within the underlying stream.
Expose a native descriptor without detaching the retained stream.
Return metadata for a stream with a known size.
Return placeholder metadata for the wrapper URL.
Details
at line 42
static mixed
getResource(StreamInterface $stream)
Return a borrowed resource without taking ownership of the underlying stream.
at line 55
static mixed
detach(StreamInterface $stream)
Transfer ownership of a stream to a PHP resource.
Unlike getResource(), closing this resource closes the supplied stream. The caller must relinquish the stream after transferring ownership.
at line 75
static mixed
createStreamContext(StreamInterface $stream)
Create a stream context for a borrowed PHP stream resource.
at line 114
static void
register()
Register the stream wrapper protocol once per process.
at line 130
bool
stream_open(string $path, string $mode, int $options, string|null $openedPath = null)
Open the PSR-7 stream supplied through its resource context.
at line 149
void
stream_close()
Close an owned stream while leaving borrowed bodies with their owner.
at line 159
string|false
stream_read(int $count)
Read bytes while preserving cancellation through producer cleanup.
at line 175
int
stream_write(string $data)
Write bytes to the underlying stream.
at line 191
bool
stream_flush()
Accept flushing for a PSR-7 stream without a separate flush operation.
at line 199
int|false
stream_tell()
Return the current stream position.
at line 215
bool
stream_eof()
Determine whether the underlying stream has ended.
at line 231
bool
stream_seek(int $offset, int $whence)
Seek within the underlying stream.
at line 251
mixed
stream_cast(int $castAs)
Expose a native descriptor without detaching the retained stream.
at line 281
array|false
stream_stat()
Return metadata for a stream with a known size.
at line 341
array
url_stat(string $path, int $flags)
Return placeholder metadata for the wrapper URL.