class ArchiveManager

Properties

protected string $disk

Storage disk for uploaded import archives.

protected string $tmpPath

Base path to the temporary directory to store extracted imports.

protected array $importTypes

Class names of available imports.

Methods

__construct()

Create a new instance.

string
store(UploadedFile $file)

Stores an uploaded archive file and returns its token.

bool
has(string $token)

Determine if the files of an import with tthe given token exist.

Import|null
get(string $token)

Get the correct import instance for the import with the given token.

delete(string $token)

Delete the files of an import.

prune()

Delete uploaded import files that are older than one week.

string
generateToken()

Generates a new token for an import.

validate(string $token)

Validate the uploaded import archive.

Details

at line 39
__construct()

Create a new instance.

at line 59
string store(UploadedFile $file)

Stores an uploaded archive file and returns its token.

Parameters

UploadedFile $file

Return Value

string

Exceptions

Exception

at line 80
bool has(string $token)

Determine if the files of an import with tthe given token exist.

Parameters

string $token

Import token.

Return Value

bool

at line 92
Import|null get(string $token)

Get the correct import instance for the import with the given token.

Parameters

string $token

Import token.

Return Value

Import|null

Exceptions

Exception

at line 141
delete(string $token)

Delete the files of an import.

Parameters

string $token

Import token.

at line 151
prune()

Delete uploaded import files that are older than one week.

at line 167
protected string generateToken()

Generates a new token for an import.

Return Value

string

at line 178
protected validate(string $token)

Validate the uploaded import archive.

Parameters

string $token

Exceptions

Exception