PostObjectV4
in package
Uses
SignatureTrait
Encapsulates the logic for getting the data for an S3 object POST upload form
Tags
Table of Contents
- $bucket : mixed
- $cache : array<string|int, mixed>
- $cacheSize : int
- $client : mixed
- $formAttributes : mixed
- $formInputs : mixed
- __construct() : mixed
- Constructs the PostObject.
- getBucket() : string
- Gets the bucket name.
- getClient() : S3ClientInterface
- Gets the S3 client.
- getFormAttributes() : array<string|int, mixed>
- Gets the form attributes as an array.
- getFormInputs() : array<string|int, mixed>
- Gets the form inputs as an array.
- setFormAttribute() : mixed
- Set a form attribute.
- setFormInput() : mixed
- Set a form input.
- getPolicyAndSignature() : mixed
- createScope() : mixed
- generateUri() : mixed
- getSigningKey() : mixed
Properties
$bucket
private
mixed
$bucket
$cache
private
array<string|int, mixed>
$cache
= []
Cache of previously signed values
$cacheSize
private
int
$cacheSize
= 0
Size of the hash cache
$client
private
mixed
$client
$formAttributes
private
mixed
$formAttributes
$formInputs
private
mixed
$formInputs
Methods
__construct()
Constructs the PostObject.
public
__construct(S3ClientInterface $client, string $bucket, array<string|int, mixed> $formInputs[, array<string|int, mixed> $options = [] ][, mixed $expiration = '+1 hours' ]) : mixed
The options array accepts the following keys:
Parameters
- $client : S3ClientInterface
-
Client used with the POST object
- $bucket : string
-
Bucket to use
- $formInputs : array<string|int, mixed>
-
Associative array of form input fields.
- $options : array<string|int, mixed> = []
-
Policy condition options
- $expiration : mixed = '+1 hours'
-
Upload expiration time value. By default: 1 hour valid period.
Tags
Return values
mixed —getBucket()
Gets the bucket name.
public
getBucket() : string
Return values
string —getClient()
Gets the S3 client.
public
getClient() : S3ClientInterface
Return values
S3ClientInterface —getFormAttributes()
Gets the form attributes as an array.
public
getFormAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFormInputs()
Gets the form inputs as an array.
public
getFormInputs() : array<string|int, mixed>
Return values
array<string|int, mixed> —setFormAttribute()
Set a form attribute.
public
setFormAttribute(string $attribute, string $value) : mixed
Parameters
- $attribute : string
-
Form attribute to set.
- $value : string
-
Value to set.
Return values
mixed —setFormInput()
Set a form input.
public
setFormInput(string $field, string $value) : mixed
Parameters
- $field : string
-
Field name to set
- $value : string
-
Value to set.
Return values
mixed —getPolicyAndSignature()
protected
getPolicyAndSignature(CredentialsInterface $credentials, array<string|int, mixed> $policy) : mixed
Parameters
- $credentials : CredentialsInterface
- $policy : array<string|int, mixed>
Return values
mixed —createScope()
private
createScope(mixed $shortDate, mixed $region, mixed $service) : mixed
Parameters
- $shortDate : mixed
- $region : mixed
- $service : mixed
Return values
mixed —generateUri()
private
generateUri() : mixed
Return values
mixed —getSigningKey()
private
getSigningKey(mixed $shortDate, mixed $region, mixed $service, mixed $secretKey) : mixed
Parameters
- $shortDate : mixed
- $region : mixed
- $service : mixed
- $secretKey : mixed