Local
class Local extends Contract
Traits
Properties
| protected | $adapter | Default propperty |
from Contract |
| protected | $filesystem | from Contract | |
| protected | $diskName | from Contract | |
| protected | $path | from Contract | |
| protected | $error | from Contract |
Methods
Check if extension is allowed or not
Took from https://stackoverflow.com/questions/5501427/php-filesize-mb-kb-conversion#answer-5501447
Clean exif info modification from https://stackoverflow.com/a/38862429/13322576
Define adapter and filesystem
Rename uploaded file with new name
Details
in
Contract at line 34
void
directories(string $directoryName = '/')
Retrieve all content of directory
in
Contract at line 45
void
makeDirectory(string $directoryName)
Make a directory
in
Contract at line 56
bool
isExists(string $path)
Check if file or directory exists or not
in
Contract at line 68
void
move(string $from, string $to)
Move file
in
Contract at line 80
void
copy(string $from, string $to)
Copy file
in
Contract at line 91
void
delete(string $inputPath)
Delete file
in
Contract at line 102
void
deleteDirectory(string $path)
Delete directory
in
Contract at line 114
void
put(string $path, mixed $content)
Create file
in
Contract at line 126
void
putStream(string $path, mixed $content)
Create stream file
in
Contract at line 137
void
read(string $path)
Read a file
in
Contract at line 148
void
readStream(string $path)
Read a file with stream
in
Contract at line 156
lastModified(string $path)
Get last modified
at line 48
object
upload(string $fileToUpload, closure $validation)
Upload file process with stream
in
Contract at line 175
string
getProviderName()
Get class name
in
Contract at line 184
getFilesystem()
Get filesystem instance
in
Contract at line 192
getDiskName()
Get filesystem instance
in
Contract at line 202
void
getPath(string $additionalPath = '')
Get main path
in
Contract at line 213
void
getSize(string $path)
Get size of file
in
Contract at line 219
getError()
No description
in
Guard at line 23
bool
isMimeAllowed(array $allowedMime = [])
Check if mime is allowed or not
in
Guard at line 41
bool
isExtensionAllowed(array $allowedExtension = [])
Check if extension is allowed or not
in
Guard at line 58
bool
isLimitExceeded(int|string $maxSize)
File size limit check
in
Guard at line 74
bool
isValid()
get upload status
in
Guard at line 85
void
destroyIfFailed()
Destroy uploaded file if file have invalid condition
in
Utils at line 21
void
toByteSize(string $NumberLimit)
Convert from '2MByte' to '2000000Byte'
in
Utils at line 46
void
toUnitSize($bytes)
in
Utils at line 82
void
getExt(string $fileToUpload)
Get extension from path info
in
Utils at line 93
string
getUploadedFileName()
Get filename of uploaded file
in
Utils at line 103
bool
getUploadStatus()
Get uploaded status
in
Utils at line 113
void
cleanExifInfo()
Clean exif info modification from https://stackoverflow.com/a/38862429/13322576
in
Stream at line 22
void
streamFile(string $filePath, string $callback = '')
Open and stream a file
in
Stream at line 54
void
download(string $filePath)
Download somae file
at line 33
__construct(string $root, string $diskName)
Define adapter and filesystem
at line 79
object
as(string $newName)
Rename uploaded file with new name