Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\FederatedProperties\GenericActionApiClient Class Reference

A Generic MediaWikiAction API client created for use in Federated Properties, but could be used for other cases. More...

Public Member Functions

 __construct (HttpRequestFactory $requestFactory, string $repoActionApiUrl, LoggerInterface $logger, string $userAgentServerName)
 
 getUserAgent ()
 
 get (array $params)
 

Private Member Functions

 getUrlFromParams (array $params)
 

Private Attributes

 $requestFactory
 
 $repoActionApiUrl
 
 $logger
 
 $userAgent
 
 $userAgentServerName
 

Detailed Description

A Generic MediaWikiAction API client created for use in Federated Properties, but could be used for other cases.

This uses MediaWiki's HttpRequestFactory to take advantage of built-in http settings such as timeouts, proxies etc. It uses an adapter to ResponseInterface to allow for consumers to also be compatible with other http clients such as Guzzle.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\FederatedProperties\GenericActionApiClient::__construct ( HttpRequestFactory $requestFactory,
string $repoActionApiUrl,
LoggerInterface $logger,
string $userAgentServerName )
Parameters
HttpRequestFactory$requestFactory
string$repoActionApiUrle.g. https://www.wikidata.org/w/api.php
LoggerInterface$logger
string$userAgentServerName

Member Function Documentation

◆ get()

Wikibase\Repo\FederatedProperties\GenericActionApiClient::get ( array $params)

◆ getUrlFromParams()

Wikibase\Repo\FederatedProperties\GenericActionApiClient::getUrlFromParams ( array $params)
private

◆ getUserAgent()

Wikibase\Repo\FederatedProperties\GenericActionApiClient::getUserAgent ( )
Returns
string

Member Data Documentation

◆ $logger

Wikibase\Repo\FederatedProperties\GenericActionApiClient::$logger
private

◆ $repoActionApiUrl

Wikibase\Repo\FederatedProperties\GenericActionApiClient::$repoActionApiUrl
private

◆ $requestFactory

Wikibase\Repo\FederatedProperties\GenericActionApiClient::$requestFactory
private

◆ $userAgent

Wikibase\Repo\FederatedProperties\GenericActionApiClient::$userAgent
private

◆ $userAgentServerName

Wikibase\Repo\FederatedProperties\GenericActionApiClient::$userAgentServerName
private

The documentation for this class was generated from the following file: