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: 593 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

StreamHandler:: (19 methods):
  __invoke()
  invokeStats()
  createResponse()
  createSink()
  checkDecode()
  drain()
  createResource()
  createStream()
  resolveHost()
  getDefaultContext()
  add_proxy()
  parse_proxy()
  add_timeout()
  add_verify()
  add_cert()
  add_progress()
  add_debug()
  addNotification()
  callArray()


Class: StreamHandler  - X-Ref

HTTP handler that uses PHP's HTTP stream wrapper.

__invoke(RequestInterface $request, array $options)   X-Ref
Sends an HTTP request.

param: RequestInterface $request Request to send.
param: array            $options Request transfer options.

invokeStats(array $options,RequestInterface $request,?float $startTime,ResponseInterface $response = null,\Throwable $error = null)   X-Ref
No description

createResponse(RequestInterface $request, array $options, $stream, ?float $startTime)   X-Ref

param: resource $stream

createSink(StreamInterface $stream, array $options)   X-Ref
No description

checkDecode(array $options, array $headers, $stream)   X-Ref

param: resource $stream

drain(StreamInterface $source, StreamInterface $sink, string $contentLength)   X-Ref
Drains the source stream into the "sink" client option.

param: string $contentLength Header specifying the amount of

createResource(callable $callback)   X-Ref
Create a resource and check to ensure it was created successfully

param: callable $callback Callable that returns stream resource
return: resource

createStream(RequestInterface $request, array $options)   X-Ref

return: resource

resolveHost(RequestInterface $request, array $options)   X-Ref
No description

getDefaultContext(RequestInterface $request)   X-Ref
No description

add_proxy(RequestInterface $request, array &$options, $value, array &$params)   X-Ref

param: mixed $value as passed via Request transfer options.

parse_proxy(string $url)   X-Ref
Parses the given proxy URL to make it compatible with the format PHP's stream context expects.


add_timeout(RequestInterface $request, array &$options, $value, array &$params)   X-Ref

param: mixed $value as passed via Request transfer options.

add_verify(RequestInterface $request, array &$options, $value, array &$params)   X-Ref

param: mixed $value as passed via Request transfer options.

add_cert(RequestInterface $request, array &$options, $value, array &$params)   X-Ref

param: mixed $value as passed via Request transfer options.

add_progress(RequestInterface $request, array &$options, $value, array &$params)   X-Ref

param: mixed $value as passed via Request transfer options.

add_debug(RequestInterface $request, array &$options, $value, array &$params)   X-Ref
No description

addNotification(array &$params, callable $notify)   X-Ref
No description

callArray(array $functions)   X-Ref
No description