Search moodle.org's
Developer Documentation

See Release Notes

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

Stream decorator trait

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

Defines 19 functions

  __construct()
  __get()
  __toString()
  getContents()
  __call()
  close()
  getMetadata()
  detach()
  getSize()
  eof()
  tell()
  isReadable()
  isWritable()
  isSeekable()
  rewind()
  seek()
  read()
  write()
  createStream()

Functions that are not part of a class:

__construct(StreamInterface $stream)   X-Ref

param: StreamInterface $stream Stream to decorate

__get(string $name)   X-Ref
Magic method used to create a new stream if streams are not added in
the constructor of a decorator (e.g., LazyOpenStream).

return: StreamInterface

__toString()   X-Ref
No description

getContents()   X-Ref
No description

__call(string $method, array $args)   X-Ref
Allow decorators to implement custom methods

return: mixed

close()   X-Ref
No description

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

return: mixed

detach()   X-Ref
No description

getSize()   X-Ref
No description

eof()   X-Ref
No description

tell()   X-Ref
No description

isReadable()   X-Ref
No description

isWritable()   X-Ref
No description

isSeekable()   X-Ref
No description

rewind()   X-Ref
No description

seek($offset, $whence = SEEK_SET)   X-Ref
No description

read($length)   X-Ref
No description

write($string)   X-Ref
No description

createStream()   X-Ref
Implement in subclasses to dynamically create streams when requested.