Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (array $methods) | |
__destruct () | |
__get ($name) | |
__toString () | |
__wakeup () | |
close () | |
detach () | |
eof () | |
getContents () | |
getMetadata ($key=null) | |
getSize () | |
isReadable () | |
isSeekable () | |
isWritable () | |
read ($length) | |
rewind () | |
seek ($offset, $whence=SEEK_SET) | |
tell () | |
write ($string) | |
Static Public Member Functions | |
static | decorate (StreamInterface $stream, array $methods) |
Compose stream implementations based on a hash of functions.
Allows for easy testing and extension of a provided stream without needing to create a concrete class for a simple extension point.
Definition at line 12 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__construct | ( | array | $methods | ) |
array | $methods | Hash of method name to a callable. |
Definition at line 28 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__destruct | ( | ) |
The close method is called on the underlying stream only if possible.
Definition at line 51 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__get | ( | $name | ) |
Lazily determine which methods are not implemented.
Definition at line 42 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__toString | ( | ) |
Reads all data from the stream into a string, from the beginning to end.
This method MUST attempt to seek to the beginning of the stream before reading data and read the stream until the end is reached.
Warning: This could attempt to load a large amount of data into memory.
This method MUST NOT raise an exception in order to conform with PHP's string casting operations.
Implements Psr\Http\Message\StreamInterface.
Definition at line 87 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__wakeup | ( | ) |
An unserialize would allow the __destruct to run when the unserialized value goes out of scope.
Definition at line 62 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::close | ( | ) |
Closes the stream and any underlying resources.
Implements Psr\Http\Message\StreamInterface.
Definition at line 92 of file FnStream.php.
|
static |
Adds custom functionality to an underlying stream by intercepting specific method calls.
StreamInterface | $stream | Stream to decorate |
array | $methods | Hash of method name to a closure |
Definition at line 76 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::detach | ( | ) |
Separates any underlying resources from the stream.
After the stream has been detached, the stream is in an unusable state.
Implements Psr\Http\Message\StreamInterface.
Definition at line 97 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 112 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::getContents | ( | ) |
Returns the remaining contents in a string
Implements Psr\Http\Message\StreamInterface.
Definition at line 152 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::getMetadata | ( | $key = null | ) |
Get stream metadata as an associative array or retrieve a specific key.
The keys returned are identical to the keys returned from PHP's stream_get_meta_data() function.
Implements Psr\Http\Message\StreamInterface.
Definition at line 157 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 102 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isReadable | ( | ) |
Returns whether or not the stream is readable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 142 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 117 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 132 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::read | ( | $length | ) |
Read data from the stream.
int | $length | Read up to $length bytes from the object and return them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 147 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::rewind | ( | ) |
Seek to the beginning of the stream.
If the stream is not seekable, this method will raise an exception; otherwise, it will perform a seek(0).
Implements Psr\Http\Message\StreamInterface.
Definition at line 122 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek to a position in the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 127 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::tell | ( | ) |
Returns the current position of the file read/write pointer
Implements Psr\Http\Message\StreamInterface.
Definition at line 107 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::write | ( | $string | ) |
Write data to the stream.
string | $string | The string that is to be written. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 137 of file FnStream.php.