SerialTransfer
extends AbstractTransfer
in package
Transfers multipart upload parts serially
Table of Contents
Constants
- AFTER_ABORT = 'multipart_upload.after_abort'
- AFTER_COMPLETE = 'multipart_upload.after_complete'
- AFTER_PART_UPLOAD = 'multipart_upload.after_part_upload'
- AFTER_UPLOAD = 'multipart_upload.after_upload'
- BEFORE_PART_UPLOAD = 'multipart_upload.before_part_upload'
- BEFORE_UPLOAD = 'multipart_upload.before_upload'
- MAX_PART_SIZE = 5368709120
- MAX_PARTS = 10000
- MIN_PART_SIZE = 5242880
Properties
- $client : AwsClientInterface
- $eventDispatcher : EventDispatcherInterface
- $options : array<string|int, mixed>
- $partSize : int
- $source : EntityBody
- $state : TransferStateInterface
- $stopped : bool
Methods
- __construct() : mixed
- Construct a new transfer object
- __invoke() : mixed
- abort() : Model
- Abort the upload
- addSubscriber() : self
- Add an event subscriber to the dispatcher
- dispatch() : Event
- Helper to dispatch Guzzle events and set the event name on the event
- getAllEvents() : array<string|int, mixed>
- Get a list of all of the events emitted from the class
- getEventDispatcher() : EventDispatcherInterface
- Get the EventDispatcher of the request
- getOptions() : array<string|int, mixed>
- Get the array of options associated with the transfer
- getSource() : EntityBodyInterface
- Get the source body of the upload
- getState() : TransferStateInterface
- Get the current state of the upload
- setEventDispatcher() : self
- Set the EventDispatcher of the request
- setOption() : self
- Set an option on the transfer
- stop() : TransferStateInterface
- Stop the transfer and retrieve the current state.
- upload() : Model|null
- Upload the source to using a multipart upload
- calculatePartSize() : int
- Determine the upload part size based on the size of the source data and taking into account the acceptable minimum and maximum part sizes.
- complete() : Model
- Complete the multipart upload
- getAbortCommand() : OperationCommand
- Fetches the abort command fom the concrete implementation
- getEventData() : array<string|int, mixed>
- Get an array used for event notifications
- init() : mixed
- Hook to initialize the transfer
- transfer() : mixed
- Hook to implement in subclasses to perform the actual transfer
Constants
AFTER_ABORT
public
mixed
AFTER_ABORT
= 'multipart_upload.after_abort'
AFTER_COMPLETE
public
mixed
AFTER_COMPLETE
= 'multipart_upload.after_complete'
AFTER_PART_UPLOAD
public
mixed
AFTER_PART_UPLOAD
= 'multipart_upload.after_part_upload'
AFTER_UPLOAD
public
mixed
AFTER_UPLOAD
= 'multipart_upload.after_upload'
BEFORE_PART_UPLOAD
public
mixed
BEFORE_PART_UPLOAD
= 'multipart_upload.before_part_upload'
BEFORE_UPLOAD
public
mixed
BEFORE_UPLOAD
= 'multipart_upload.before_upload'
MAX_PART_SIZE
public
mixed
MAX_PART_SIZE
= 5368709120
MAX_PARTS
public
mixed
MAX_PARTS
= 10000
MIN_PART_SIZE
public
mixed
MIN_PART_SIZE
= 5242880
Properties
$client
protected
AwsClientInterface
$client
Client used for the transfers
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$options
protected
array<string|int, mixed>
$options
Associative array of options
$partSize
protected
int
$partSize
Size of each part to upload
$source
protected
EntityBody
$source
Data source of the transfer
$state
protected
TransferStateInterface
$state
State of the transfer
$stopped
protected
bool
$stopped
= false
Whether or not the transfer has been stopped
Methods
__construct()
Construct a new transfer object
public
__construct(AwsClientInterface $client, TransferStateInterface $state, EntityBody $source[, array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $client : AwsClientInterface
-
Client used for the transfers
- $state : TransferStateInterface
-
State used to track transfer
- $source : EntityBody
-
Data source of the transfer
- $options : array<string|int, mixed> = array()
-
Array of options to apply
__invoke()
public
__invoke() : mixed
abort()
Abort the upload
public
abort() : Model
Return values
Model —Returns the result of the abort multipart upload command
addSubscriber()
Add an event subscriber to the dispatcher
public
addSubscriber(EventSubscriberInterface $subscriber) : self
Parameters
- $subscriber : EventSubscriberInterface
-
Event subscriber
Return values
selfdispatch()
Helper to dispatch Guzzle events and set the event name on the event
public
dispatch(mixed $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
- $eventName : mixed
-
Name of the event to dispatch
- $context : array<string|int, mixed> = array()
-
Context of the event
Return values
Event —Returns the created event object
getAllEvents()
Get a list of all of the events emitted from the class
public
static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>getEventDispatcher()
Get the EventDispatcher of the request
public
getEventDispatcher() : EventDispatcherInterface
Return values
EventDispatcherInterfacegetOptions()
Get the array of options associated with the transfer
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getSource()
Get the source body of the upload
public
getSource() : EntityBodyInterface
Return values
EntityBodyInterfacegetState()
Get the current state of the upload
public
getState() : TransferStateInterface
Return values
TransferStateInterfacesetEventDispatcher()
Set the EventDispatcher of the request
public
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : self
Parameters
- $eventDispatcher : EventDispatcherInterface
Return values
selfsetOption()
Set an option on the transfer
public
setOption(string $option, mixed $value) : self
Parameters
- $option : string
-
Name of the option
- $value : mixed
-
Value to set
Return values
selfstop()
Stop the transfer and retrieve the current state.
public
stop() : TransferStateInterface
Return values
TransferStateInterfaceupload()
Upload the source to using a multipart upload
public
upload() : Model|null
Tags
Return values
Model|null —Result of the complete multipart upload command or null if uploading was stopped
calculatePartSize()
Determine the upload part size based on the size of the source data and taking into account the acceptable minimum and maximum part sizes.
protected
calculatePartSize() : int
Return values
int —The part size
complete()
Complete the multipart upload
protected
complete() : Model
Return values
Model —Returns the result of the complete multipart upload command
getAbortCommand()
Fetches the abort command fom the concrete implementation
protected
getAbortCommand() : OperationCommand
Return values
OperationCommandgetEventData()
Get an array used for event notifications
protected
getEventData([OperationCommand $command = null ]) : array<string|int, mixed>
Parameters
- $command : OperationCommand = null
-
Command to include in event data
Return values
array<string|int, mixed>init()
Hook to initialize the transfer
protected
init() : mixed
Tags
transfer()
Hook to implement in subclasses to perform the actual transfer
protected
transfer() : mixed