class UserAgentGenerator

UserAgentGenerator class.

This class is responsible for generating the "X-Contentful-User-Agent" header, which collects the PHP version, SDK version, and possibly application and integration names and versions.

Methods

__construct(string $name, string $version)

UserAgentGenerator constructor.

$this
setApplication(string $name, string $version = '')

Set the application name and version.

$this
setIntegration(string $name, string $version = '')

Set the application name and version.

getUserAgent()

Returns the value of the User-Agent header for any requests made to Contentful.

Details

at line 46
__construct(string $name, string $version)

UserAgentGenerator constructor.

Parameters

string $name
string $version

at line 57
$this setApplication(string $name, string $version = '')

Set the application name and version.

The values are used as part of the X-Contentful-User-Agent header.

Parameters

string $name
string $version

Return Value

$this

at line 73
$this setIntegration(string $name, string $version = '')

Set the application name and version.

The values are used as part of the X-Contentful-User-Agent header.

Parameters

string $name
string $version

Return Value

$this

at line 114
getUserAgent()

Returns the value of the User-Agent header for any requests made to Contentful.