Constants

VERSION

VERSION = '2.0.8'

Properties

$httpClient

$httpClient

$config

$config : array

Type

array

$description

$description : \GuzzleHttp\Command\Guzzle\DescriptionInterface

Type

DescriptionInterface — Guzzle service description

$handlerStack

$handlerStack : \GuzzleHttp\HandlerStack

Type

HandlerStack

$commandToRequestTransformer

$commandToRequestTransformer : callable

Type

callable

$responseToResultTransformer

$responseToResultTransformer : callable

Type

callable

$api

$api

$desc

$desc

$action

$action

$operation

$operation

$cosConfig

$cosConfig

$signature

$signature

$rawCosConfig

$rawCosConfig

Methods

__construct()

__construct(mixed  $cosConfig) : mixed

The client constructor accepts an associative array of configuration options:

  • defaults: Associative array of default command parameters to add to each command created by the client.
  • validate: Specify if command input is validated (defaults to true). Changing this setting after the client has been created will have no effect.
  • process: Specify if HTTP responses are parsed (defaults to true). Changing this setting after the client has been created will have no effect.
  • response_locations: Associative array of location types mapping to ResponseLocationInterface objects.

Parameters

mixed $cosConfig

Returns

mixed —

getCommand()

getCommand(mixed  $name, array  $params = []) : \GuzzleHttp\Command\CommandInterface

Create a command for an operation name.

Special keys may be set on the command to control how it behaves. Implementations SHOULD be able to utilize the following keys or throw an exception if unable.

Parameters

mixed $name

Name of the operation to use in the command

array $params

Returns

\GuzzleHttp\Command\CommandInterface —

getDescription()

getDescription() : \GuzzleHttp\Command\Guzzle\DescriptionInterface

Return the description

Returns

\GuzzleHttp\Command\Guzzle\DescriptionInterface —

getConfig()

getConfig(array|string  $option = null) : mixed

Get the config of the client

Parameters

array|string $option

Returns

mixed —

setConfig()

setConfig( $option,  $value) : mixed

Parameters

$option
$value

Returns

mixed —

getHttpClient()

getHttpClient() : \GuzzleHttp\ClientInterface

Get the HTTP client used to send requests for the web service client

Returns

\GuzzleHttp\ClientInterface —

getHandlerStack()

getHandlerStack() : \GuzzleHttp\HandlerStack

Get the HandlerStack which can be used to add middleware to the client.

Returns

\GuzzleHttp\HandlerStack —

execute()

execute(\GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Command\ResultInterface

Execute a single command.

Parameters

\GuzzleHttp\Command\CommandInterface $command

Command to execute

Returns

\GuzzleHttp\Command\ResultInterface —

The result of the executed command

executeAsync()

executeAsync(\GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Promise\PromiseInterface

Execute a single command asynchronously

Parameters

\GuzzleHttp\Command\CommandInterface $command

Command to execute

Returns

\GuzzleHttp\Promise\PromiseInterface —

A Promise that resolves to a Result.

executeAll()

executeAll(mixed  $commands, array  $options = []) : array

Executes multiple commands concurrently using a fixed pool size.

Parameters

mixed $commands

Array or iterator that contains CommandInterface objects to execute with the client.

array $options

Associative array of options to apply.

  • concurrency: (int) Max number of commands to execute concurrently.
  • fulfilled: (callable) Function to invoke when a command completes.
  • rejected: (callable) Function to invoke when a command fails.

Returns

array —

executeAllAsync()

executeAllAsync(mixed  $commands, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Executes multiple commands concurrently and asynchronously using a fixed pool size.

Parameters

mixed $commands

Array or iterator that contains CommandInterface objects to execute with the client.

array $options

Associative array of options to apply.

  • concurrency: (int) Max number of commands to execute concurrently.
  • fulfilled: (callable) Function to invoke when a command completes.
  • rejected: (callable) Function to invoke when a command fails.

Returns

\GuzzleHttp\Promise\PromiseInterface —

__call()

__call(mixed  $method, array  $args) : mixed

Parameters

mixed $method
array $args

Returns

mixed —

commandToRequestTransformer()

commandToRequestTransformer(\GuzzleHttp\Command\CommandInterface  $command) : mixed

Parameters

\GuzzleHttp\Command\CommandInterface $command

Returns

mixed —

responseToResultTransformer()

responseToResultTransformer(\Psr\Http\Message\ResponseInterface  $response, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\CommandInterface  $command) : mixed

Parameters

\Psr\Http\Message\ResponseInterface $response
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\CommandInterface $command

Returns

mixed —

__destruct()

__destruct() : mixed

Returns

mixed —

getApi()

getApi() : mixed

Returns

mixed —

getPresignetUrl()

getPresignetUrl(mixed  $method, mixed  $args, mixed  $expires = null) : mixed

Parameters

mixed $method
mixed $args
mixed $expires

Returns

mixed —

getObjectUrl()

getObjectUrl(mixed  $bucket, mixed  $key, mixed  $expires = null, array  $args = array()) : mixed

Parameters

mixed $bucket
mixed $key
mixed $expires
array $args

Returns

mixed —

upload()

upload(mixed  $bucket, mixed  $key, mixed  $body, mixed  $options = array()) : mixed

Parameters

mixed $bucket
mixed $key
mixed $body
mixed $options

Returns

mixed —

resumeUpload()

resumeUpload(mixed  $bucket, mixed  $key, mixed  $body, mixed  $uploadId, mixed  $options = array()) : mixed

Parameters

mixed $bucket
mixed $key
mixed $body
mixed $uploadId
mixed $options

Returns

mixed —

copy()

copy(mixed  $bucket, mixed  $key, mixed  $copySource, mixed  $options = array()) : mixed

Parameters

mixed $bucket
mixed $key
mixed $copySource
mixed $options

Returns

mixed —

doesBucketExist()

doesBucketExist(mixed  $bucket, array  $options = array()) : mixed

Parameters

mixed $bucket
array $options

Returns

mixed —

doesObjectExist()

doesObjectExist(mixed  $bucket, mixed  $key, array  $options = array()) : mixed

Parameters

mixed $bucket
mixed $key
array $options

Returns

mixed —

explodeKey()

explodeKey(mixed  $key) : mixed

Parameters

mixed $key

Returns

mixed —

handleSignature()

handleSignature(mixed  $secretId, mixed  $secretKey) : mixed

Parameters

mixed $secretId
mixed $secretKey

Returns

mixed —

handleErrors()

handleErrors() : mixed

Returns

mixed —

processConfig()

processConfig(array  $config) : mixed

Prepares the client based on the configuration settings of the client.

Parameters

array $config

Constructor config as an array

Returns

mixed —

getSerializer()

getSerializer(callable|null  $commandToRequestTransformer) : \GuzzleHttp\Command\Guzzle\Serializer

Returns the passed Serializer when set, a new instance otherwise

Parameters

callable|null $commandToRequestTransformer

Returns

\GuzzleHttp\Command\Guzzle\Serializer —

getDeserializer()

getDeserializer(callable|null  $responseToResultTransformer) : \GuzzleHttp\Command\Guzzle\Deserializer

Returns the passed Deserializer when set, a new instance otherwise

Parameters

callable|null $responseToResultTransformer

Returns

\GuzzleHttp\Command\Guzzle\Deserializer —

createCommandHandler()

createCommandHandler() : callable

Defines the main handler for commands that uses the HTTP client.

Returns

callable —

transformCommandToRequest()

transformCommandToRequest(\GuzzleHttp\Command\CommandInterface  $command) : \Psr\Http\Message\RequestInterface

Transforms a Command object into a Request object.

Parameters

\GuzzleHttp\Command\CommandInterface $command

Returns

\Psr\Http\Message\RequestInterface —

transformResponseToResult()

transformResponseToResult(\Psr\Http\Message\ResponseInterface  $response, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Command\ResultInterface

Transforms a Response object, also using data from the Request object, into a Result object.

Parameters

\Psr\Http\Message\ResponseInterface $response
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\CommandInterface $command

Returns

\GuzzleHttp\Command\ResultInterface —

getCosConfig()

getCosConfig() : mixed

Returns

mixed —

createPresignedUrl()

createPresignedUrl(\Psr\Http\Message\RequestInterface  $request, mixed  $expires) : mixed

Parameters

\Psr\Http\Message\RequestInterface $request
mixed $expires

Returns

mixed —