ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Provides a read only stream that pumps data from a PHP callable. More...
Public Member Functions | |
__construct (callable $source, array $options=[]) | |
__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... | |
Private Member Functions | |
pump ($length) | |
Private Attributes | |
$source | |
$size | |
$tellPos = 0 | |
$metadata | |
$buffer | |
Provides a read only stream that pumps data from a PHP callable.
When invoking the provided callable, the PumpStream will pass the amount of data requested to read to the callable. The callable can choose to ignore this value and return fewer or more bytes than requested. Any extra data returned by the provided callable is buffered internally until drained using the read() function of the PumpStream. The provided callable MUST return false when there is no more data to read.
Definition at line 16 of file PumpStream.php.
GuzzleHttp\Psr7\PumpStream::__construct | ( | callable | $source, |
array | $options = [] |
||
) |
callable | $source | Source of the stream data. The callable MAY accept an integer argument used to control the amount of data to return. The callable MUST return a string when called, or false on error or EOF. |
array | $options | Stream options:
|
Definition at line 43 of file PumpStream.php.
References PHPMailer\PHPMailer\$options, GuzzleHttp\Psr7\PumpStream\$source, and size.
GuzzleHttp\Psr7\PumpStream::__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 51 of file PumpStream.php.
References GuzzleHttp\Psr7\copy_to_string().
GuzzleHttp\Psr7\PumpStream::close | ( | ) |
Closes the stream and any underlying resources.
Implements Psr\Http\Message\StreamInterface.
Definition at line 60 of file PumpStream.php.
References GuzzleHttp\Psr7\PumpStream\detach().
GuzzleHttp\Psr7\PumpStream::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 65 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\close().
GuzzleHttp\Psr7\PumpStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 81 of file PumpStream.php.
References GuzzleHttp\Psr7\PumpStream\$source.
Referenced by GuzzleHttp\Psr7\PumpStream\getContents().
GuzzleHttp\Psr7\PumpStream::getContents | ( | ) |
Returns the remaining contents in a string.
Implements Psr\Http\Message\StreamInterface.
Definition at line 132 of file PumpStream.php.
References $result, GuzzleHttp\Psr7\PumpStream\eof(), and GuzzleHttp\Psr7\PumpStream\read().
GuzzleHttp\Psr7\PumpStream::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 142 of file PumpStream.php.
References $key, and GuzzleHttp\Psr7\PumpStream\$metadata.
GuzzleHttp\Psr7\PumpStream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 71 of file PumpStream.php.
References GuzzleHttp\Psr7\PumpStream\$size.
GuzzleHttp\Psr7\PumpStream::isReadable | ( | ) |
Returns whether or not the stream is readable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 111 of file PumpStream.php.
GuzzleHttp\Psr7\PumpStream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 86 of file PumpStream.php.
GuzzleHttp\Psr7\PumpStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 101 of file PumpStream.php.
|
private |
Definition at line 151 of file PumpStream.php.
References $data.
Referenced by GuzzleHttp\Psr7\PumpStream\read().
GuzzleHttp\Psr7\PumpStream::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 116 of file PumpStream.php.
References $data, $remaining, and GuzzleHttp\Psr7\PumpStream\pump().
Referenced by GuzzleHttp\Psr7\PumpStream\getContents().
GuzzleHttp\Psr7\PumpStream::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 91 of file PumpStream.php.
References GuzzleHttp\Psr7\PumpStream\seek().
GuzzleHttp\Psr7\PumpStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek to a position in the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 96 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\rewind().
GuzzleHttp\Psr7\PumpStream::tell | ( | ) |
Returns the current position of the file read/write pointer.
Implements Psr\Http\Message\StreamInterface.
Definition at line 76 of file PumpStream.php.
References GuzzleHttp\Psr7\PumpStream\$tellPos.
GuzzleHttp\Psr7\PumpStream::write | ( | $string | ) |
Write data to the stream.
string | $string | The string that is to be written. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 106 of file PumpStream.php.
|
private |
Definition at line 31 of file PumpStream.php.
|
private |
Definition at line 28 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\getMetadata().
|
private |
Definition at line 22 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\getSize().
|
private |
Definition at line 19 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\__construct(), and GuzzleHttp\Psr7\PumpStream\eof().
|
private |
Definition at line 25 of file PumpStream.php.
Referenced by GuzzleHttp\Psr7\PumpStream\tell().