Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 248 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

AppendStream:: (17 methods):
  __construct()
  __toString()
  addStream()
  getContents()
  close()
  detach()
  tell()
  getSize()
  eof()
  rewind()
  seek()
  read()
  isReadable()
  isWritable()
  isSeekable()
  write()
  getMetadata()


Class: AppendStream  - X-Ref

Reads from multiple streams, one after the other.

This is a read-only stream decorator.
__construct(array $streams = [])   X-Ref

param: StreamInterface[] $streams Streams to decorate. Each stream must

__toString()   X-Ref
No description

addStream(StreamInterface $stream)   X-Ref
Add a stream to the AppendStream

param: StreamInterface $stream Stream to append. Must be readable.

getContents()   X-Ref
No description

close()   X-Ref
Closes each attached stream.


detach()   X-Ref
Detaches each attached stream.

Returns null as it's not clear which underlying stream resource to return.

tell()   X-Ref
No description

getSize()   X-Ref
Tries to calculate the size by adding the size of each stream.

If any of the streams do not return a valid number, then the size of the
append stream cannot be determined and null is returned.

eof()   X-Ref
No description

rewind()   X-Ref
No description

seek($offset, $whence = SEEK_SET)   X-Ref
Attempts to seek to the given position. Only supports SEEK_SET.


read($length)   X-Ref
Reads from all of the appended streams until the length is met or EOF.


isReadable()   X-Ref
No description

isWritable()   X-Ref
No description

isSeekable()   X-Ref
No description

write($string)   X-Ref
No description

getMetadata($key = null)   X-Ref
{@inheritdoc}

return: mixed