AbstractJsonApiClient

abstract class \TYPO3\CMS\Extensionmanager\Remote\AbstractJsonApiClient

What the clients of TER's JSON interfaces share: one GET for a JSON document, cached in the "extensionmanager_ter_api" cache so repeating a question does not cost a request - that includes the answer that an extension is unknown, which is what TER says about most of the extensions installed locally - and a short memory of the remote not answering, so an offline installation does not wait for the timeout on every question it asks.

Table of Contents

Constants

UNAVAILABLE_CACHE_IDENTIFIER  : mixed = 'remote_api_unavailable'
UNAVAILABLE_LIFETIME  : mixed = 300

Properties

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

Methods

__construct()  : mixed
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 = 'remote_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