Download the PHP package amircandy/litefs without Composer
On this page you can find all versions of the php package amircandy/litefs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amircandy/litefs
More information about amircandy/litefs
Files in amircandy/litefs
Package litefs
Short Description LiteFS is a lightweight, fast, and easy-to-use PHP file system manager library.
License MIT
Informations about the package litefs
LiteFS - Lightweight PHP File Manager Library
LiteFS is a modern, fast, and easy-to-use PHP library for managing files and directories. It provides a clean API for common file management tasks such as creating directories, copying files, moving files, deleting files, and more.
Features
- Create directories and files
- Copy directories and files
- Move or rename files and directories
- Delete files and directories
- List files and directories
- Check if files or directories exist
- Handle file paths relative to a given root path
- Supports recursive directory iteration
Installation
You can install LiteFS by cloning the repository or by downloading the source code directly. ( Composer is avalible , install by : )
Clone the repository
Manual Download
Download the ZIP file from GitHub and extract it.
Usage
1. Create a FileManager Instance
The constructor accepts the path to the base directory where the operations will be performed.
2. Create a Directory
Creates a new directory relative to the base directory.
3. Copy a Directory
Copies the entire directory, including subdirectories and files.
4. Move a File or Directory
Moves or renames a file or directory.
5. Delete a File or Directory
Deletes the specified file or directory. If it's a directory, it deletes all files inside it recursively.
6. Check if a File or Directory Exists
Returns true if the file or directory exists, otherwise false.
7. List Files in a Directory
Lists all files inside the specified directory. It returns an array of file names.
8. Get File Size
Returns the size of the file in bytes.
9. Delete Multiple Files
Deletes multiple files in one call.
API Reference
LiteFS Methods
__construct(string $basePath): Initializes theLiteFSwith the specified base directory.createDir(string $path): Creates a new directory.copyDir(string $src, string $dest): Copies a directory fromsrctodest.move(string $src, string $dest): Moves or renames a file or directory.delete(string $path): Deletes a file or directory.deleteMultiple(array $files): Deletes multiple files.exists(string $path): Checks if a file or directory exists.listFiles(string $path): Lists files in a directory.getFileSize(string $path): Gets the size of a file.
To-Do List for LiteFS Development
Features to Add
- [ ] Add support for file permissions (read/write/execute).
- [ ] Add file search functionality within directories.
- [ ] Create a logging mechanism for all file operations performed by the library.
- [ ] Add support for symbolic links.
- [ ] Add file compression (zip/gzip) and decompression support.
- [ ] Support for file timestamps (last modified, creation date).
- [ ] Support for file ownership.
Contributing
If you'd like to contribute to LiteFS, please fork the repository and submit a pull request. Contributions are welcome!
License
This project is licensed under the MIT License - see the LICENSE file for details.