SDK for PHP 3.x

UserAgentMiddleware
in package

Builds and injects the user agent header values.

This middleware must be appended into step where all the metrics to be gathered are already resolved. As of now it should be after the signing step.

Table of Contents

Constants

AGENT_VERSION  = 2.1

Properties

$metricsFnList  : mixed
$userAgentFnList  : mixed

Methods

__construct()  : mixed
__invoke()  : mixed
When invoked, its injects the user agent header into the request headers.
wrap()  : Closure
Returns a middleware wrapper function.

Constants

AGENT_VERSION

public mixed AGENT_VERSION = 2.1

Properties

$metricsFnList

public static mixed $metricsFnList = ['appendEndpointMetric', 'appendAccountIdModeMetric', 'appendRetryConfigMetric']

$userAgentFnList

public static mixed $userAgentFnList = ['getSdkVersion', 'getUserAgentVersion', 'getHhvmVersion', 'getOsName', 'getLangVersion', 'getExecEnv', 'getEndpointDiscovery', 'getAppId', 'getMetrics']

Methods

__construct()

public __construct(callable $nextHandler[, array<string|int, mixed> $args = [] ]) : mixed
Parameters
$nextHandler : callable
$args : array<string|int, mixed> = []

wrap()

Returns a middleware wrapper function.

public static wrap(array<string|int, mixed> $args) : Closure
Parameters
$args : array<string|int, mixed>
Return values
Closure
On this page