|
| __construct (callable $source, array $options=[]) |
|
| __toString () |
| Reads all data from the stream into a string, from the beginning to end.
|
|
| close () |
| Closes the stream and any underlying resources.
|
|
| detach () |
| Separates any underlying resources from the stream.
|
|
| eof () |
| Returns true if the stream is at the end of the stream.
|
|
| getContents () |
| Returns the remaining contents in a string.
|
|
| getMetadata ($key=null) |
|
| getSize () |
| Get the size of the stream if known.
|
|
| isReadable () |
| Returns whether or not the stream is readable.
|
|
| isSeekable () |
| Returns whether or not the stream is seekable.
|
|
| isWritable () |
| Returns whether or not the stream is writable.
|
|
| read ($length) |
| Read data from the stream.
|
|
| rewind () |
| Seek to the beginning of the stream.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Seek to a position in the stream.
|
|
| tell () |
| Returns the current position of the file read/write pointer.
|
|
| write ($string) |
| Write data to the stream.
|
|
◆ __construct()
GuzzleHttp\Psr7\PumpStream::__construct |
( |
callable | $source, |
|
|
array | $options = [] ) |
- Parameters
-
callable(int) | (string|false|null) $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|null on error or EOF. |
array{size? | int, metadata?: array} $options Stream options:
- metadata: Hash of metadata to use with stream.
- size: Size of the stream, if known.
|
◆ __toString()
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.
- See also
- http://php.net/manual/en/language.oop5.magic.php#object.tostring
- Return values
-
Implements Psr\Http\Message\StreamInterface.
◆ close()
GuzzleHttp\Psr7\PumpStream::close |
( |
| ) |
|
◆ 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.
- Return values
-
resource|null | Underlying PHP stream, if any |
Implements Psr\Http\Message\StreamInterface.
◆ eof()
GuzzleHttp\Psr7\PumpStream::eof |
( |
| ) |
|
◆ getContents()
GuzzleHttp\Psr7\PumpStream::getContents |
( |
| ) |
|
Returns the remaining contents in a string.
- Return values
-
- Exceptions
-
RuntimeException | if unable to read or an error occurs while reading. |
Implements Psr\Http\Message\StreamInterface.
◆ getMetadata()
GuzzleHttp\Psr7\PumpStream::getMetadata |
( |
| $key = null | ) |
|
◆ getSize()
GuzzleHttp\Psr7\PumpStream::getSize |
( |
| ) |
|
◆ isReadable()
GuzzleHttp\Psr7\PumpStream::isReadable |
( |
| ) |
|
◆ isSeekable()
GuzzleHttp\Psr7\PumpStream::isSeekable |
( |
| ) |
|
◆ isWritable()
GuzzleHttp\Psr7\PumpStream::isWritable |
( |
| ) |
|
◆ read()
GuzzleHttp\Psr7\PumpStream::read |
( |
| $length | ) |
|
Read data from the stream.
- Parameters
-
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. |
- Return values
-
string | Returns the data read from the stream, or an empty string if no bytes are available. |
- Exceptions
-
RuntimeException | if an error occurs. |
Implements Psr\Http\Message\StreamInterface.
◆ rewind()
GuzzleHttp\Psr7\PumpStream::rewind |
( |
| ) |
|
◆ seek()
GuzzleHttp\Psr7\PumpStream::seek |
( |
| $offset, |
|
|
| $whence = SEEK_SET ) |
Seek to a position in the stream.
@externalurl http://www.php.net/manual/en/function.fseek.php
- Parameters
-
int | $offset | Stream offset |
int | $whence | Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek() . SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset. |
- Exceptions
-
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
◆ tell()
GuzzleHttp\Psr7\PumpStream::tell |
( |
| ) |
|
Returns the current position of the file read/write pointer.
- Return values
-
int | Position of the file pointer |
- Exceptions
-
RuntimeException | on error. |
Implements Psr\Http\Message\StreamInterface.
◆ write()
GuzzleHttp\Psr7\PumpStream::write |
( |
| $string | ) |
|
Write data to the stream.
- Parameters
-
string | $string | The string that is to be written. |
- Return values
-
int | Returns the number of bytes written to the stream. |
- Exceptions
-
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
The documentation for this class was generated from the following file:
- lib/guzzlehttp/psr7/src/PumpStream.php