MediaWiki master
MediaWiki\Shell\ShellboxClientFactory Class Reference

This is a service which provides a configured client to access a remote Shellbox installation. More...

Public Member Functions

 __construct (HttpRequestFactory $requestFactory, $urls, $key)
 
 getClient (array $options=[])
 Get a Shellbox client with the specified options.
 
 getRemoteRpcClient (array $options=[])
 Get a Shellbox RPC client with the specified options.
 
 getRpcClient (array $options=[])
 Get a Shellbox RPC client with specified options.
 
 isEnabled (?string $service=null)
 Test whether remote Shellbox is enabled by configuration.
 

Public Attributes

const DEFAULT_TIMEOUT = 10
 The default request timeout, in seconds.
 

Detailed Description

This is a service which provides a configured client to access a remote Shellbox installation.

Since
1.36

Definition at line 19 of file ShellboxClientFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Shell\ShellboxClientFactory::__construct ( HttpRequestFactory $requestFactory,
$urls,
$key )
Access: internal
Use MediaWikiServices::getShellboxClientFactory()
Parameters
HttpRequestFactory$requestFactoryThe factory which will be used to make HTTP clients.
(string|false|null)[]|null$urls The Shellbox base URL mapping
string | null$keyThe shared secret key used for HMAC authentication

Definition at line 37 of file ShellboxClientFactory.php.

Member Function Documentation

◆ getClient()

MediaWiki\Shell\ShellboxClientFactory::getClient ( array $options = [])

Get a Shellbox client with the specified options.

If remote Shellbox is not configured (isEnabled() returns false), an exception will be thrown.

Parameters
array$optionsAssociative array of options:
  • timeout: The request timeout in seconds
  • service: the shellbox backend name to get the URL from the mapping
Returns
Client
Exceptions
RuntimeException

Definition at line 63 of file ShellboxClientFactory.php.

References $url.

◆ getRemoteRpcClient()

MediaWiki\Shell\ShellboxClientFactory::getRemoteRpcClient ( array $options = [])

Get a Shellbox RPC client with the specified options.

If remote Shellbox is not configured (isEnabled() returns false), an exception will be thrown.

Parameters
array$optionsAssociative array of options:
  • timeout: The request timeout in seconds
  • service: the shellbox backend name to get the URL from the mapping
Returns
RpcClient
Exceptions
RuntimeException

Definition at line 91 of file ShellboxClientFactory.php.

◆ getRpcClient()

MediaWiki\Shell\ShellboxClientFactory::getRpcClient ( array $options = [])

Get a Shellbox RPC client with specified options.

If remote Shellbox is not configured (isEnabled() returns false), a local fallback is returned.

Parameters
array$options
Returns
RpcClient

Definition at line 102 of file ShellboxClientFactory.php.

Referenced by RemoteIcuCollation\__construct().

◆ isEnabled()

MediaWiki\Shell\ShellboxClientFactory::isEnabled ( ?string $service = null)

Test whether remote Shellbox is enabled by configuration.

Parameters
string | null$serviceSame as the service option for getClient.
Returns
bool

Definition at line 49 of file ShellboxClientFactory.php.

Member Data Documentation

◆ DEFAULT_TIMEOUT

const MediaWiki\Shell\ShellboxClientFactory::DEFAULT_TIMEOUT = 10

The default request timeout, in seconds.

Definition at line 28 of file ShellboxClientFactory.php.


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