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.

(no description)

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

Defines 1 class

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


Class: PumpStream  - X-Ref

Provides a read only stream that pumps data from a PHP callable.

When invoking the provided callable, the PumpStream will pass the amount of
data requested to read to the callable. The callable can choose to ignore
this value and return fewer or more bytes than requested. Any extra data
returned by the provided callable is buffered internally until drained using
the read() function of the PumpStream. The provided callable MUST return
false when there is no more data to read.
__construct(callable $source, array $options = [])   X-Ref

param: callable(int): (string|null|false)  $source  Source of the stream data. The callable MAY
param: array{size?: int, metadata?: array} $options Stream options:

__toString()   X-Ref
No description

close()   X-Ref
No description

detach()   X-Ref
No description

getSize()   X-Ref
No description

tell()   X-Ref
No description

eof()   X-Ref
No description

isSeekable()   X-Ref
No description

rewind()   X-Ref
No description

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

isWritable()   X-Ref
No description

write($string)   X-Ref
No description

isReadable()   X-Ref
No description

read($length)   X-Ref
No description

getContents()   X-Ref
No description

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

return: mixed

pump(int $length)   X-Ref
No description