CacheUpload
in package
File upload cache
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- clearMoved() : void
- Clear moved files
- move() : void
- Readdress uploaded file to $_FILES
- upload() : string|null
- Cache uploaded file to temporary directory
- clear() : void
- Remove old files
Properties
$dir
public
static string
$dir
= 'upload/'
Directory for temporary uploads
$timer
public
static int
$timer
= 43200
How long keep file alive (12h)
$fileApi
protected
FileApiPhp
$fileApi
$moved
protected
array<string|int, string>
$moved
= []
$path
protected
string
$path
Methods
__construct()
public
__construct(FileApiPhp $fileApi, string $dir) : mixed
Parameters
- $fileApi : FileApiPhp
- $dir : string
clearMoved()
Clear moved files
public
clearMoved() : void
move()
Readdress uploaded file to $_FILES
public
move(string $fileTemp, string $mark, int $id) : void
Parameters
- $fileTemp : string
- $mark : string
- $id : int
Tags
upload()
Cache uploaded file to temporary directory
public
upload(string $file, string $mark) : string|null
Parameters
- $file : string
- $mark : string
Tags
Return values
string|nullclear()
Remove old files
protected
clear() : void