AbstractUploader
extends AbstractUploadManager
in package
Table of Contents
- $source : StreamInterface
- __construct() : mixed
- createPart() : array<string|int, mixed>|null
- Generates the parameters for an upload part by analyzing a range of the source starting from the current offset up to the part size.
- getNumberOfParts() : mixed
- getUploadCommands() : mixed
- limitPartStream() : LimitStream
- Create a stream for a part that starts at the current position and has a length of the upload part size (or less with the final part).
- determineSource() : StreamInterface
- Turns the provided source into a stream and stores it.
- isEof() : bool
- Checks if the source is at EOF.
Properties
$source
protected
StreamInterface
$source
Source of the data to be uploaded.
Methods
__construct()
public
__construct(AwsClientInterface $client, mixed $source[, array<string|int, mixed> $config = [] ]) : mixed
Parameters
- $client : AwsClientInterface
- $source : mixed
- $config : array<string|int, mixed> = []
Return values
mixed —createPart()
Generates the parameters for an upload part by analyzing a range of the source starting from the current offset up to the part size.
protected
abstract createPart(bool $seekable, int $number) : array<string|int, mixed>|null
Parameters
- $seekable : bool
- $number : int
Return values
array<string|int, mixed>|null —getNumberOfParts()
protected
getNumberOfParts(mixed $partSize) : mixed
Parameters
- $partSize : mixed
Return values
mixed —getUploadCommands()
protected
getUploadCommands(callable $resultHandler) : mixed
Parameters
- $resultHandler : callable
Return values
mixed —limitPartStream()
Create a stream for a part that starts at the current position and has a length of the upload part size (or less with the final part).
protected
limitPartStream(StreamInterface $stream) : LimitStream
Parameters
- $stream : StreamInterface
Return values
LimitStream —determineSource()
Turns the provided source into a stream and stores it.
private
determineSource(mixed $source) : StreamInterface
If a string is provided, it is assumed to be a filename, otherwise, it
passes the value directly to Psr7\stream_for().
Parameters
- $source : mixed
Return values
StreamInterface —isEof()
Checks if the source is at EOF.
private
isEof(bool $seekable) : bool
Parameters
- $seekable : bool