class ArchiveManager

Properties

protectedstring $disk Storage disk for uploaded import archives.
protectedstring $tmpPath Base path to the temporary directory to store extracted imports.
protectedarray $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 line39
__construct()

Create a new instance.

at line59
string store(UploadedFile$file)

Stores an uploaded archive file and returns its token.

Parameters

UploadedFile $file

Return Value

string

Exceptions

Exception If the import archive is corrupt.

at line80
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 line92
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 If the import files are invalid.

at line141
delete(string$token)

Delete the files of an import.

Parameters

string $token Import token.

at line151
prune()

Delete uploaded import files that are older than one week.

at line167
protectedstring generateToken()

Generates a new token for an import.

Return Value

string

at line178
protected validate(string$token)

Validate the uploaded import archive.

Parameters

string $token

Exceptions

Exception If the import archive is invalid.