SDK for PHP V3

UploadDirectoryRequest extends AbstractTransferRequest
in package

FinalYes

Table of Contents

Constants

DEFAULT_MAX_CONCURRENCY  = 100

Properties

$configKeys  : array<string|int, mixed>

Methods

__construct()  : mixed
getConfig()  : array<string|int, mixed>
getListeners()  : array<string|int, mixed>
Get current listeners.
getProgressTracker()  : AbstractTransferListener|null
Get the progress tracker.
getS3Client()  : S3ClientInterface|null
getSourceDirectory()  : string
getTargetBucket()  : string
getUploadRequestArgs()  : array<string|int, mixed>
updateConfigWithDefaults()  : void
validateConfig()  : void
For validating config. By default, it provides an empty implementation.
validateSourceDirectory()  : void
Helper method to validate source directory

Constants

DEFAULT_MAX_CONCURRENCY

public mixed DEFAULT_MAX_CONCURRENCY = 100

Properties

$configKeys

public static array<string|int, mixed> $configKeys = ['follow_symbolic_links' => 'bool', 'recursive' => 'bool', 's3_prefix' => 'string', 'filter' => 'callable', 's3_delimiter' => 'string', 'upload_object_request_modifier' => 'callable', 'failure_policy' => 'callable', 'max_concurrency' => 'int', 'max_depth' => 'int', 'track_progress' => 'bool']

Methods

__construct()

public __construct(string $sourceDirectory, string $targetBucket[, array<string|int, mixed> $uploadRequestArgs = [] ][, array<string|int, mixed> $config = [] ][, array<string|int, mixed> $listeners = [] ][, AbstractTransferListener|null $progressTracker = null ]) : mixed
Parameters
$sourceDirectory : string

The source directory to upload.

$targetBucket : string

The name of the bucket to upload objects to.

$uploadRequestArgs : array<string|int, mixed> = []

The extract arguments to be passed in each upload request.

$config : array<string|int, mixed> = []
  • follow_symbolic_links: (boolean, optional) Whether to follow symbolic links when traversing the file tree.
  • recursive: (boolean, optional) Whether to upload directories recursively.
  • s3_prefix: (string, optional) The S3 key prefix to use for each object. If not provided, files will be uploaded to the root of the bucket.
  • filter: (callable, optional) A callback to allow users to filter out unwanted files. It is invoked for each file. An example implementation is a predicate that takes a file and returns a boolean indicating whether this file should be uploaded.
  • s3_delimiter: The S3 delimiter. A delimiter causes a list operation to roll up all the keys that share a common prefix into a single summary list result.
  • upload_object_request_modifier: (callable, optional) A callback mechanism to allow customers to update individual putObjectRequest that the S3 Transfer Manager generates.
  • failure_policy: (callable, optional) The failure policy to handle failed requests.
  • max_concurrency: (int, optional) The max number of concurrent uploads.
  • max_depth: (int, optional) To indicate the maximum depth of the recursive file tree walk. By default, it will use the built-in default value which is -1.
$listeners : array<string|int, mixed> = []

For listening to transfer events such as transferInitiated.

$progressTracker : AbstractTransferListener|null = null

For showing progress in transfers.

getConfig()

public getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getListeners()

Get current listeners.

public getListeners() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSourceDirectory()

public getSourceDirectory() : string
Return values
string

getTargetBucket()

public getTargetBucket() : string
Return values
string

getUploadRequestArgs()

public getUploadRequestArgs() : array<string|int, mixed>
Return values
array<string|int, mixed>

updateConfigWithDefaults()

public updateConfigWithDefaults(array<string|int, mixed> $defaultConfig) : void
Parameters
$defaultConfig : array<string|int, mixed>

validateConfig()

For validating config. By default, it provides an empty implementation.

public validateConfig() : void

validateSourceDirectory()

Helper method to validate source directory

public validateSourceDirectory() : void
<-- modeled_exceptions -->
On this page