CoolCMS API

TimeoutComgateTransport
in package
implements ITransport

FinalYes

Comgate client transport with HTTP timeouts.

The vendor transport sets no CURLOPT_TIMEOUT, so a stuck gateway would hold a PHP worker. This one behaves the same (request and response formats match the library) with a 5 s connect timeout and a 10 s total timeout.

Table of Contents

Interfaces

ITransport

Constants

CONNECT_TIMEOUT  : mixed = 5
TIMEOUT  : mixed = 10

Properties

$config  : Config
$connectTimeout  : int
$timeout  : int

Methods

__construct()  : mixed
delete()  : Response
get()  : Response
getConfig()  : Config
post()  : Response
postJson()  : Response
putJson()  : Response
setConfig()  : ITransport
createResponse()  : MessageInterface
execute()  : Response
rest()  : Response

Constants

Properties

Methods

__construct()

public __construct(Config $config[, int $connectTimeout = self::CONNECT_TIMEOUT ][, int $timeout = self::TIMEOUT ]) : mixed
Parameters
$config : Config
$connectTimeout : int = self::CONNECT_TIMEOUT
$timeout : int = self::TIMEOUT

delete()

public delete(string $uri[, array<string|int, mixed> $options = [] ]) : Response
Parameters
$uri : string
$options : array<string|int, mixed> = []
Return values
Response

get()

public get(string $uri[, array<string|int, mixed> $options = [] ]) : Response
Parameters
$uri : string
$options : array<string|int, mixed> = []
Return values
Response

post()

public post(string $uri, array<string|int, mixed> $data[, array<string|int, mixed> $options = [] ]) : Response
Parameters
$uri : string
$data : array<string|int, mixed>
$options : array<string|int, mixed> = []
Return values
Response

postJson()

public postJson(string $uri, array<string|int, mixed> $data[, array<string|int, mixed> $options = [] ]) : Response
Parameters
$uri : string
$data : array<string|int, mixed>
$options : array<string|int, mixed> = []
Return values
Response

putJson()

public putJson(string $uri, array<string|int, mixed> $data[, array<string|int, mixed> $options = [] ]) : Response
Parameters
$uri : string
$data : array<string|int, mixed>
$options : array<string|int, mixed> = []
Return values
Response

setConfig()

public setConfig(Config $config) : ITransport
Parameters
$config : Config
Return values
ITransport

createResponse()

private createResponse(string $raw) : MessageInterface
Parameters
$raw : string
Return values
MessageInterface

execute()

private execute(non-empty-string $method, string $uri, string|null $body, array<string|int, string> $headers) : Response
Parameters
$method : non-empty-string
$uri : string
$body : string|null
$headers : array<string|int, string>
Return values
Response

rest()

private rest(non-empty-string $method, string $uri[, array<string|int, mixed> $data = [] ]) : Response
Parameters
$method : non-empty-string
$uri : string
$data : array<string|int, mixed> = []
Return values
Response
On this page

Search results