Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | ||||||
__construct (int $hwm=16384) | ||||||
__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) | ||||||
{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.@externalurl http://php.net/manual/en/function.stream-get-meta-data.php
| ||||||
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) | ||||||
Reads data from the buffer. | ||||||
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) | ||||||
Writes data to the buffer. | ||||||
GuzzleHttp\Psr7\BufferStream::__construct | ( | int | $hwm = 16384 | ) |
int | $hwm | High water mark, representing the preferred maximum buffer size. If the size of the buffer exceeds the high water mark, then calls to write will continue to succeed but will return 0 to inform writers to slow down until the buffer has been drained by reading from it. |
GuzzleHttp\Psr7\BufferStream::__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.
string |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::close | ( | ) |
Closes the stream and any underlying resources.
void |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::detach | ( | ) |
Separates any underlying resources from the stream.
After the stream has been detached, the stream is in an unusable state.
resource|null | Underlying PHP stream, if any |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
bool |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::getContents | ( | ) |
Returns the remaining contents in a string.
string |
RuntimeException | if unable to read or an error occurs while reading. |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::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.@externalurl http://php.net/manual/en/function.stream-get-meta-data.php
string | $key | Specific metadata to retrieve. |
array|mixed|null | Returns an associative array if no key is provided. Returns a specific key value if a key is provided and the value is found, or null if the key is not found. |
mixed |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::getSize | ( | ) |
Get the size of the stream if known.
int|null | Returns the size in bytes if known, or null if unknown. |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::isReadable | ( | ) |
Returns whether or not the stream is readable.
bool |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
bool |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
bool |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::read | ( | $length | ) |
Reads data from the buffer.
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::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).
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::seek | ( | $offset, | |
$whence = SEEK_SET ) |
Seek to a position in the stream.
@externalurl http://www.php.net/manual/en/function.fseek.php
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. |
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::tell | ( | ) |
Returns the current position of the file read/write pointer.
int | Position of the file pointer |
RuntimeException | on error. |
Implements Psr\Http\Message\StreamInterface.
GuzzleHttp\Psr7\BufferStream::write | ( | $string | ) |
Writes data to the buffer.
Implements Psr\Http\Message\StreamInterface.