MediaWiki REL1_39
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 20 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 38 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 64 of file ShellboxClientFactory.php.

◆ 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 94 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 105 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 50 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 29 of file ShellboxClientFactory.php.


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