FairPackageClient

class \TYPO3\CMS\Extensionmanager\Remote\FairPackageClient

Extends
AbstractJsonApiClient

Reads the FAIR metadata document TER serves for an extension at https://extensions.typo3.org/fair/v1/packages/{extensionKey}.

One document carries every release of the extension with its requirements, artifact URL and checksum, which is all that resolving a package for download needs. Browsing is not its business: FAIR defines no listing or search, TerApiClient answers those.

Table of Contents

Constants

UNAVAILABLE_CACHE_IDENTIFIER  : mixed = 'fair_api_unavailable'
UNAVAILABLE_LIFETIME  : mixed = 300

Properties

$cache  : FrontendInterface
$requestFactory  : RequestFactory
$typo3Version  : Typo3Version

Methods

__construct()  : mixed
getPackage()  : FairPackage|null
getRequestOptions()  : array<string, mixed>
Error statuses are inspected here rather than thrown by the HTTP client, since a 404 is an answer. The timeouts are deliberately short: the imported list answers when TER is slow, which beats leaving the module hanging.
isSuccessfulResponse()  : bool
requestJson()  : array|null

Constants

UNAVAILABLE_CACHE_IDENTIFIER

protected mixed UNAVAILABLE_CACHE_IDENTIFIER = 'fair_api_unavailable'

UNAVAILABLE_LIFETIME

protected mixed UNAVAILABLE_LIFETIME = 300

Properties

Methods

getRequestOptions()

Error statuses are inspected here rather than thrown by the HTTP client, since a 404 is an answer. The timeouts are deliberately short: the imported list answers when TER is slow, which beats leaving the module hanging.

protected getRequestOptions() : array<string, mixed>

Return values

array<string, mixed>

isSuccessfulResponse()

protected isSuccessfulResponse(ResponseInterface $response) : bool

Parameters

$response : ResponseInterface

Return values

bool

requestJson()

protected requestJson(string $url) : array|null

Parameters

$url : string

Tags

throws
ApiRequestFailedException

when the remote could not answer at all

Return values

array|null —

null when the remote does not know the resource

On this page