ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Compose stream implementations based on a hash of functions. More...
Public Member Functions | |
__construct (array $methods) | |
__get ($name) | |
Lazily determine which methods are not implemented. More... | |
__destruct () | |
The close method is called on the underlying stream only if possible. More... | |
__toString () | |
Reads all data from the stream into a string, from the beginning to end. More... | |
close () | |
Closes the stream and any underlying resources. More... | |
detach () | |
Separates any underlying resources from the stream. More... | |
getSize () | |
Get the size of the stream if known. More... | |
tell () | |
Returns the current position of the file read/write pointer. More... | |
eof () | |
Returns true if the stream is at the end of the stream. More... | |
isSeekable () | |
Returns whether or not the stream is seekable. More... | |
rewind () | |
Seek to the beginning of the stream. More... | |
seek ($offset, $whence=SEEK_SET) | |
Seek to a position in the stream. More... | |
isWritable () | |
Returns whether or not the stream is writable. More... | |
write ($string) | |
Write data to the stream. More... | |
isReadable () | |
Returns whether or not the stream is readable. More... | |
read ($length) | |
Read data from the stream. More... | |
getContents () | |
Returns the remaining contents in a string. More... | |
getMetadata ($key=null) | |
Get stream metadata as an associative array or retrieve a specific key. More... | |
Static Public Member Functions | |
static | decorate (StreamInterface $stream, array $methods) |
Adds custom functionality to an underlying stream by intercepting specific method calls. More... | |
Private Attributes | |
$methods | |
Static Private Attributes | |
static | $slots |
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 25 of file FnStream.php.
References GuzzleHttp\Psr7\FnStream\$methods, and $name.
GuzzleHttp\Psr7\FnStream::__destruct | ( | ) |
The close method is called on the underlying stream only if possible.
Definition at line 48 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::__get | ( | $name | ) |
Lazily determine which methods are not implemented.
Definition at line 39 of file FnStream.php.
References $name.
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 75 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::close | ( | ) |
Closes the stream and any underlying resources.
Implements Psr\Http\Message\StreamInterface.
Definition at line 80 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 64 of file FnStream.php.
References GuzzleHttp\Psr7\FnStream\$methods, and GuzzleHttp\Psr7\$stream.
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 85 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 100 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::getContents | ( | ) |
Returns the remaining contents in a string.
Implements Psr\Http\Message\StreamInterface.
Definition at line 140 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 145 of file FnStream.php.
References $key.
GuzzleHttp\Psr7\FnStream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 90 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isReadable | ( | ) |
Returns whether or not the stream is readable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 130 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 105 of file FnStream.php.
GuzzleHttp\Psr7\FnStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 120 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 135 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 110 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 115 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 95 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 125 of file FnStream.php.
|
private |
Definition at line 15 of file FnStream.php.
Referenced by GuzzleHttp\Psr7\FnStream\__construct(), and GuzzleHttp\Psr7\FnStream\decorate().
|
staticprivate |
Definition at line 18 of file FnStream.php.