FileStorage class
This class holds utils to save and delete file.
Example
$file = new File('docs', 'cv.pdf', 'base64 content');
FileStorage::saveFile($file);
FileStorage::deleteFile($file);
FileStorage::deleteFolder('./folder_to_be_deleted');
| package |
Default |
|---|
_deleteFolder(string $dir) : void
Recursive private method to delete a folder
string
delete() : void
Delete the file from persistent storage.
Example
$file = new File('docs', 'cv.pdf', '');
$fileStorage = new FileStorage($file);
$fileStorage->delete();deleteFile(\TinyORM\File $file) : \TinyORM\FileStorage
Short hand static method to delete a file.
Example
$file = new File('docs', 'cv.pdf', '');
FileStorage::deleteFile($file);\TinyORM\File
\TinyORM\FileStorage
deleteFolder(string $path) : void
Short hand static method to delete a filder.
Example
FileStorage::deleteFolder('./folder_to_be_deleted');string
save() : void
Save the file to a persistent storage.
Example
$file = new File('docs', 'cv.pdf', 'base64 content');
$fileStorage = new FileStorage($file);
$fileStorage->save();saveFile(\TinyORM\File $file) : \TinyORM\FileStorage
Short hand static method to save a file.
Example
$file = new File('docs', 'cv.pdf', 'base64 content');
FileStorage::saveFile($file);\TinyORM\File
\TinyORM\FileStorage