UploadSyncBuilder
extends AbstractSyncBuilder
in package
Table of Contents
Properties
- $acp : string|Acp
- $baseDir : string
- $bucket : string
- $client : S3Client
- $concurrency : int
- $debug : bool
- $delimiter : string
- $forcing : bool
- $keyPrefix : string
- $multipartUploadSize : int
- $params : array<string|int, mixed>
- $sourceConverter : FilenameConverterInterface
- $sourceIterator : Iterator
- $targetConverter : FilenameConverterInterface
Methods
- addRegexFilter() : $this
- Add a filename filter that uses a regular expression to filter out files that you do not wish to transfer.
- build() : AbstractSync
- Builds a UploadSync or DownloadSync object
- enableDebugOutput() : $this
- Enable debug mode
- force() : $this
- Set to true to force transfers even if a file already exists and has not changed
- getInstance() : static
- setAcl() : $this
- Set a canned ACL to apply to each uploaded object
- setAcp() : $this
- Set an Access Control Policy to apply to each uploaded object
- setBaseDir() : $this
- Set the base directory of the files being transferred. The base directory is removed from each file path before converting the file path to an object key or vice versa.
- setBucket() : $this
- Set the bucket to use with the sync
- setClient() : $this
- Set the Amazon S3 client object that will send requests
- setConcurrency() : $this
- Set the number of files that can be transferred concurrently
- setDelimiter() : $this
- Specify the delimiter used for the targeted filesystem (default delimiter is "/")
- setKeyPrefix() : $this
- Specify a prefix to prepend to each Amazon S3 object key or the prefix where object are stored in a bucket
- setMultipartUploadSize() : $this
- Set the multipart upload size threshold. When the size of a file exceeds this value, the file will be uploaded using a multipart upload.
- setOperationParams() : $this
- Specify an array of operation parameters to apply to each operation executed by the sync object
- setSourceFilenameConverter() : $this
- Set a custom object key provider instead of building one internally
- setSourceIterator() : $this
- Set a custom iterator that returns \SplFileInfo objects for the source data
- setTargetFilenameConverter() : $this
- Set a custom object key provider instead of building one internally
- uploadFromDirectory() : $this
- Set the path that contains files to recursively upload to Amazon S3
- uploadFromGlob() : $this
- Set a glob expression that will match files to upload to Amazon S3
- addCustomParamListener() : mixed
- Add the custom param listener to a transfer object
- addDebugListener() : mixed
- Add a listener to the sync object to output debug information while transferring
- assertFileIteratorSet() : mixed
- Ensure that the base file iterator has been provided
- createS3Iterator() : OpendirIterator
- Create an Amazon S3 file iterator based on the given builder settings
- filterIterator() : Iterator
- Wraps a generated iterator in a filter iterator that removes directories
- getDefaultSourceConverter() : FilenameConverterInterface
- getDefaultTargetConverter() : FilenameConverterInterface
- getTargetIterator() : Iterator
- specificBuild() : AbstractSync
- Hook to implement in subclasses
- validateRequirements() : mixed
- Validate that the builder has the minimal requirements
Properties
$acp
protected
string|Acp
$acp
= 'private'
Access control policy to set on each object
$baseDir
protected
string
$baseDir
Base directory to remove from each file path before converting to an object name or file name
$bucket
protected
string
$bucket
Bucket used with the transfer
$client
protected
S3Client
$client
Amazon S3 client used to send requests
$concurrency
protected
int
$concurrency
= 10
Number of files that can be transferred concurrently
$debug
protected
bool
$debug
Whether or not debug output is enable
$delimiter
protected
string
$delimiter
= '/'
Directory separator for Amazon S3 keys
$forcing
protected
bool
$forcing
= false
Whether or not to only transfer modified or new files
$keyPrefix
protected
string
$keyPrefix
= ''
Prefix at prepend to each Amazon S3 object key
$multipartUploadSize
protected
int
$multipartUploadSize
$params
protected
array<string|int, mixed>
$params
= array()
Custom parameters to add to each operation sent while transferring
$sourceConverter
protected
FilenameConverterInterface
$sourceConverter
$sourceIterator
protected
Iterator
$sourceIterator
Iterator that returns SplFileInfo objects to upload
$targetConverter
protected
FilenameConverterInterface
$targetConverter
Methods
addRegexFilter()
Add a filename filter that uses a regular expression to filter out files that you do not wish to transfer.
public
addRegexFilter(string $search) : $this
Parameters
- $search : string
-
Regular expression search (in preg_match format). Any filename that matches this regex will not be transferred.
Return values
$thisbuild()
Builds a UploadSync or DownloadSync object
public
build() : AbstractSync
Return values
AbstractSyncenableDebugOutput()
Enable debug mode
public
enableDebugOutput([bool|resource $enabledOrResource = true ]) : $this
Parameters
- $enabledOrResource : bool|resource = true
-
Set to true or false to enable or disable debug output. Pass an opened fopen resource to write to instead of writing to standard out.
Return values
$thisforce()
Set to true to force transfers even if a file already exists and has not changed
public
force([bool $force = false ]) : $this
Parameters
- $force : bool = false
-
Set to true to force transfers without checking if it has changed
Return values
$thisgetInstance()
public
static getInstance() : static
Return values
staticsetAcl()
Set a canned ACL to apply to each uploaded object
public
setAcl(string $acl) : $this
Parameters
- $acl : string
-
Canned ACL for each upload
Return values
$thissetAcp()
Set an Access Control Policy to apply to each uploaded object
public
setAcp(Acp $acp) : $this
Parameters
- $acp : Acp
-
Access control policy
Return values
$thissetBaseDir()
Set the base directory of the files being transferred. The base directory is removed from each file path before converting the file path to an object key or vice versa.
public
setBaseDir(string $baseDir) : $this
Parameters
- $baseDir : string
-
Base directory, which will be deleted from each uploaded object key
Return values
$thissetBucket()
Set the bucket to use with the sync
public
setBucket(string $bucket) : $this
Parameters
- $bucket : string
-
Amazon S3 bucket name
Return values
$thissetClient()
Set the Amazon S3 client object that will send requests
public
setClient(S3Client $client) : $this
Parameters
- $client : S3Client
-
Amazon S3 client
Return values
$thissetConcurrency()
Set the number of files that can be transferred concurrently
public
setConcurrency(int $concurrency) : $this
Parameters
- $concurrency : int
-
Number of concurrent transfers
Return values
$thissetDelimiter()
Specify the delimiter used for the targeted filesystem (default delimiter is "/")
public
setDelimiter(string $delimiter) : $this
Parameters
- $delimiter : string
-
Delimiter to use to separate paths
Return values
$thissetKeyPrefix()
Specify a prefix to prepend to each Amazon S3 object key or the prefix where object are stored in a bucket
public
setKeyPrefix(string $keyPrefix) : $this
Can be used to upload files to a pseudo sub-folder key or only download files from a pseudo sub-folder
Parameters
- $keyPrefix : string
-
Prefix for each uploaded key
Return values
$thissetMultipartUploadSize()
Set the multipart upload size threshold. When the size of a file exceeds this value, the file will be uploaded using a multipart upload.
public
setMultipartUploadSize(int $size) : $this
Parameters
- $size : int
-
Size threshold
Return values
$thissetOperationParams()
Specify an array of operation parameters to apply to each operation executed by the sync object
public
setOperationParams(array<string|int, mixed> $params) : $this
Parameters
- $params : array<string|int, mixed>
-
Associative array of PutObject (upload) GetObject (download) parameters
Return values
$thissetSourceFilenameConverter()
Set a custom object key provider instead of building one internally
public
setSourceFilenameConverter(FileNameConverterInterface $converter) : $this
Parameters
- $converter : FileNameConverterInterface
-
Filename to object key provider
Return values
$thissetSourceIterator()
Set a custom iterator that returns \SplFileInfo objects for the source data
public
setSourceIterator(Iterator $iterator) : $this
Parameters
- $iterator : Iterator
Return values
$thissetTargetFilenameConverter()
Set a custom object key provider instead of building one internally
public
setTargetFilenameConverter(FileNameConverterInterface $converter) : $this
Parameters
- $converter : FileNameConverterInterface
-
Filename to object key provider
Return values
$thisuploadFromDirectory()
Set the path that contains files to recursively upload to Amazon S3
public
uploadFromDirectory(string $path) : $this
Parameters
- $path : string
-
Path that contains files to upload
Return values
$thisuploadFromGlob()
Set a glob expression that will match files to upload to Amazon S3
public
uploadFromGlob(string $glob) : $this
Parameters
- $glob : string
-
Glob expression
Tags
Return values
$thisaddCustomParamListener()
Add the custom param listener to a transfer object
protected
addCustomParamListener(HasDispatcherInterface $sync) : mixed
Parameters
- $sync : HasDispatcherInterface
addDebugListener()
Add a listener to the sync object to output debug information while transferring
protected
addDebugListener(AbstractSync $sync, mixed $resource) : mixed
Parameters
- $sync : AbstractSync
-
Sync object to listen to
- $resource : mixed
-
Where to write debug messages
assertFileIteratorSet()
Ensure that the base file iterator has been provided
protected
assertFileIteratorSet() : mixed
Tags
createS3Iterator()
Create an Amazon S3 file iterator based on the given builder settings
protected
createS3Iterator() : OpendirIterator
Return values
OpendirIteratorfilterIterator()
Wraps a generated iterator in a filter iterator that removes directories
protected
filterIterator(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
-
Iterator to wrap
Tags
Return values
IteratorgetDefaultSourceConverter()
protected
getDefaultSourceConverter() : FilenameConverterInterface
Return values
FilenameConverterInterfacegetDefaultTargetConverter()
protected
getDefaultTargetConverter() : FilenameConverterInterface
Return values
FilenameConverterInterfacegetTargetIterator()
protected
getTargetIterator() : Iterator
Return values
IteratorspecificBuild()
Hook to implement in subclasses
protected
specificBuild() : AbstractSync
Return values
AbstractSyncvalidateRequirements()
Validate that the builder has the minimal requirements
protected
validateRequirements() : mixed