A generic client which executes actions on the Shellbox server.
More...
|
| __construct (ClientInterface $httpClient, UriInterface $uri, $key) |
|
| setLogger (LoggerInterface $logger) |
|
| call ( $routeName, $functionName, $params=[], $options=[]) |
|
| sendRequest ( $path, $parts, $outputFiles=[], $outputGlobs=[]) |
| Send an arbitrary request to the server.
|
|
A generic client which executes actions on the Shellbox server.
◆ __construct()
Shellbox\Client::__construct |
( |
ClientInterface | $httpClient, |
|
|
UriInterface | $uri, |
|
|
| $key ) |
- Parameters
-
ClientInterface | $httpClient | An object which requests an HTTP resource. It is permissible to throw an exception for propagation back to the caller. However, a successfully received response with a status code of >=400 should ideally be returned to Shellbox as a ResponseInterface, so that Shellbox can parse and rethrow its own error messages. With Guzzle this could be achieved by passing setting RequestOptions::HTTP_ERROR option to false when creating the client. |
UriInterface | $uri | The base URI of the server |
string | $key | The key for HMAC authentication |
◆ sendRequest()
Shellbox\Client::sendRequest |
( |
| $path, |
|
|
| $parts, |
|
|
| $outputFiles = [], |
|
|
| $outputGlobs = [] ) |
Send an arbitrary request to the server.
- Parameters
-
string | $path | The URL path relative to the server's base URL |
array | $parts | An array of multipart parts to send, in the format specified by MultipartStream. Each part is an associative array which for our purposes may contain:
- "name": The part name. Required but ignored when there is a Content-Disposition header.
- "contents": Here always a StreamInterface or string
- "headers": An associative array of part headers.
|
OutputFile[] | $outputFiles | Output files. The objects will have their contents populated with data received from the server. |
OutputGlob[] | $outputGlobs | Output globs. The objects will have be populated with data received from the server. |
- Returns
- array An associative array of output data
- Exceptions
-
◆ setLogger()
Shellbox\Client::setLogger |
( |
LoggerInterface | $logger | ) |
|
The documentation for this class was generated from the following file: