|
Moodle PHP Documentation 4.4
Moodle 4.4.9+ (Build: 20250711) (4ea86454947)
|
Public Member Functions | |
| __construct (array $elements=[], string $boundary=null) | |
| __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. | |
| getBoundary () | |
| getContents () | |
| Returns the remaining contents in a string. | |
| getMetadata ($key=null) | |
| Get stream metadata as an associative array or retrieve a specific key. | |
| 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. | |
Protected Member Functions | |
| createStream (array $elements=[]) | |
| Create the aggregate stream that will be used to upload the POST data. | |
| GuzzleHttp\Psr7\MultipartStream::__construct | ( | array | $elements = [], |
| string | $boundary = null ) |
| array | $elements | Array of associative arrays, each containing a required "name" key mapping to the form field, name, a required "contents" key mapping to a StreamInterface/resource/string, an optional "headers" associative array of custom headers, and an optional "filename" key mapping to a string to send as the filename in the part. |
| string | $boundary | You can optionally provide a specific boundary |
| InvalidArgumentException |
|
inherited |
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 |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Closes the stream and any underlying resources.
| void |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
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 |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Returns true if the stream is at the end of the stream.
| bool |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Returns the remaining contents in a string.
| string |
| RuntimeException | if unable to read or an error occurs while reading. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
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. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Get the size of the stream if known.
| int|null | Returns the size in bytes if known, or null if unknown. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Returns whether or not the stream is readable.
| bool |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Returns whether or not the stream is seekable.
| bool |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\NoSeekStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
| GuzzleHttp\Psr7\MultipartStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
| bool |
Implements Psr\Http\Message\StreamInterface.
|
inherited |
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. |
| string | Returns the data read from the stream, or an empty string if no bytes are available. |
| RuntimeException | if an error occurs. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
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. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
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. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\NoSeekStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Returns the current position of the file read/write pointer.
| int | Position of the file pointer |
| RuntimeException | on error. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.
|
inherited |
Write data to the stream.
| string | $string | The string that is to be written. |
| int | Returns the number of bytes written to the stream. |
| RuntimeException | on failure. |
Implemented in GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, GuzzleHttp\Psr7\DroppingStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\Stream.