MediaWiki  master
MediaWiki\Shell\ShellboxClientFactory Class Reference

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

Collaboration diagram for MediaWiki\Shell\ShellboxClientFactory:

Public Member Functions

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

Public Attributes

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

Private Member Functions

 getUrl (?string $service)
 

Private Attributes

string null $key
 
HttpRequestFactory $requestFactory
 
string false null[] null $urls
 

Detailed Description

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

Since
1.36

Definition at line 15 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 33 of file ShellboxClientFactory.php.

References MediaWiki\Shell\ShellboxClientFactory\$key, MediaWiki\Shell\ShellboxClientFactory\$requestFactory, and MediaWiki\Shell\ShellboxClientFactory\$urls.

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

Definition at line 59 of file ShellboxClientFactory.php.

References MediaWiki\Shell\ShellboxClientFactory\getUrl().

◆ getUrl()

MediaWiki\Shell\ShellboxClientFactory::getUrl ( ?string  $service)
private

◆ 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 45 of file ShellboxClientFactory.php.

References MediaWiki\Shell\ShellboxClientFactory\getUrl().

Member Data Documentation

◆ $key

string null MediaWiki\Shell\ShellboxClientFactory::$key
private

◆ $requestFactory

HttpRequestFactory MediaWiki\Shell\ShellboxClientFactory::$requestFactory
private

◆ $urls

string false null [] null MediaWiki\Shell\ShellboxClientFactory::$urls
private

◆ DEFAULT_TIMEOUT

const MediaWiki\Shell\ShellboxClientFactory::DEFAULT_TIMEOUT = 10

The default request timeout, in seconds.

Definition at line 24 of file ShellboxClientFactory.php.


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