Documentation

Fopen
in package
implements ClientInterface Uses ParseHeadersTrait

Fopen implementation of the Horde HTTP Client

Ported from the original Request and Response designs by Chuck Hagenbuch

Interfaces, Classes, Traits and Enums

ClientInterface

Table of Contents

$errors  : array<string|int, mixed>
$options  : Options
$parsedCode  : mixed
Catch a parsed http return code
$parsedHttpVersion  : mixed
$responseFactory  : ResponseFactoryInterface
$streamFactory  : StreamFactoryInterface
__construct()  : mixed
sendRequest()  : ResponseInterface
errorHandler()  : mixed
Helper for catching fopen errors, hopefully getting a HTTP error code
parseHeaders()  : mixed
Parse a string or array of strings into a set of headers

Properties

$errors

private array<string|int, mixed> $errors = []

$parsedCode

Catch a parsed http return code

private mixed $parsedCode = null

Some clients like fopen rely on this.

$responseFactory

private ResponseFactoryInterface $responseFactory

$streamFactory

private StreamFactoryInterface $streamFactory

Methods

__construct()

public __construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, Options $options) : mixed
Parameters
$responseFactory : ResponseFactoryInterface
$streamFactory : StreamFactoryInterface
$options : Options
Return values
mixed

sendRequest()

public sendRequest(RequestInterface $request) : ResponseInterface
Parameters
$request : RequestInterface
Return values
ResponseInterface

errorHandler()

Helper for catching fopen errors, hopefully getting a HTTP error code

protected errorHandler(mixed $errno, mixed $errstr, mixed $errfile, mixed $errline, mixed $errcontext) : mixed
Parameters
$errno : mixed
$errstr : mixed
$errfile : mixed
$errline : mixed
$errcontext : mixed
Return values
mixed

parseHeaders()

Parse a string or array of strings into a set of headers

private parseHeaders(mixed $headers) : mixed

We might move this to a trait

Parameters
$headers : mixed
Return values
mixed

Search results