AbstractResumableTransfer
in package
AbstractYes
Table of Contents
Methods
- __construct() : mixed
- deleteResumeFile() : void
- fromFile() : self
- Load a resumable state from a file.
- fromJson() : self
- Deserialize a resumable state from JSON format.
- getBucket() : string
- getConfig() : array<string|int, mixed>
- getCurrentSnapshot() : array<string|int, mixed>
- getKey() : string
- getRequestArgs() : array<string|int, mixed>
- getResumeFilePath() : string
- isResumeFile() : bool
- Check if a file path is a valid resume file.
- toFile() : void
- Save the resumable state to a file.
- toJson() : string
- Serialize the resumable state to JSON format.
- updateCurrentSnapshot() : void
- Update the current snapshot.
Methods
__construct()
public
__construct(string $resumeFilePath, array<string|int, mixed> $requestArgs, array<string|int, mixed> $config, array<string|int, mixed> $currentSnapshot) : mixed
Parameters
- $resumeFilePath : string
- $requestArgs : array<string|int, mixed>
-
The request arguments used for the transfer
- $config : array<string|int, mixed>
-
The config used in the request
- $currentSnapshot : array<string|int, mixed>
-
The current progress snapshot
deleteResumeFile()
public
deleteResumeFile([string|null $filePath = null ]) : void
Parameters
- $filePath : string|null = null
fromFile()
Load a resumable state from a file.
public
abstract static fromFile(string $filePath) : self
Parameters
- $filePath : string
-
Path to the resume file
Tags
Return values
selffromJson()
Deserialize a resumable state from JSON format.
public
abstract static fromJson(string $json) : self
Parameters
- $json : string
-
JSON-encoded state
Tags
Return values
selfgetBucket()
public
getBucket() : string
Return values
stringgetConfig()
public
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentSnapshot()
public
getCurrentSnapshot() : array<string|int, mixed>
Return values
array<string|int, mixed>getKey()
public
getKey() : string
Return values
stringgetRequestArgs()
public
getRequestArgs() : array<string|int, mixed>
Return values
array<string|int, mixed>getResumeFilePath()
public
getResumeFilePath() : string
Return values
stringisResumeFile()
Check if a file path is a valid resume file.
public
static isResumeFile(string $filePath) : bool
Parameters
- $filePath : string
Return values
booltoFile()
Save the resumable state to a file.
public
toFile([string|null $filePath = null ]) : void
When a file path is not provided by default it will use
the resumeFilePath property.
Parameters
- $filePath : string|null = null
-
Path where the resume file should be saved
toJson()
Serialize the resumable state to JSON format.
public
abstract toJson() : string
Return values
string —JSON-encoded state
updateCurrentSnapshot()
Update the current snapshot.
public
updateCurrentSnapshot(array<string|int, mixed> $snapshot) : void
Parameters
- $snapshot : array<string|int, mixed>
-
The new snapshot data