AbstractJsonApiClient
abstract class \
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.
Internal
This class is a specific implementation and is not part of the Public TYPO3 API.
Table of Contents
Constants
- UNAVAILABLE_CACHE_IDENTIFIER : mixed = 'remote_api_unavailable'
- UNAVAILABLE_LIFETIME : mixed = 300
Properties
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
$cache read-only
protected
FrontendInterface
$cache
$requestFactory read-only
protected
RequestFactory
$requestFactory
$typo3Version read-only
protected
Typo3Version
$typo3Version
Methods
__construct()
public
__construct(RequestFactory $requestFactory, FrontendInterface $cache, Typo3Version $typo3Version) : mixed
Parameters
- $requestFactory : RequestFactory
- $cache : FrontendInterface
- $typo3Version : Typo3Version
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
boolrequestJson()
protected
requestJson(string $url) : array|null
Parameters
- $url : string
Tags
Return values
array|null —null when the remote does not know the resource