PHPackages                             amircandy/litefs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. amircandy/litefs

ActiveLibrary[File &amp; Storage](/categories/file-storage)

amircandy/litefs
================

LiteFS is a lightweight, fast, and easy-to-use PHP file system manager library.

v0.1(1y ago)10MITPHPPHP &gt;=7.2CI passing

Since Apr 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AmiRCandy/LiteFS)[ Packagist](https://packagist.org/packages/amircandy/litefs)[ RSS](/packages/amircandy-litefs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

---

**LiteFS - Lightweight PHP File Manager Library**
=================================================

[](#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**
------------

[](#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**
----------------

[](#installation)

You can install `LiteFS` by cloning the repository or by downloading the source code directly. ( Composer is avalible , install by : `composer require amircandy/litefs`)

### **Clone the repository**

[](#clone-the-repository)

```
git clone https://github.com/AmiRCandy/LiteFS.git
cd LiteFS
```

### **Manual Download**

[](#manual-download)

Download the ZIP file from [GitHub](https://github.com/AmiRCandy/LiteFS) and extract it.

---

**Usage**
---------

[](#usage)

### **1. Create a FileManager Instance**

[](#1-create-a-filemanager-instance)

```
use LiteFS\LiteFS;

$fileManager = new LiteFS('/path/to/base/directory');
```

The constructor accepts the path to the base directory where the operations will be performed.

---

### **2. Create a Directory**

[](#2-create-a-directory)

```
$fileManager->createDir('my/new/directory');
```

Creates a new directory relative to the base directory.

---

### **3. Copy a Directory**

[](#3-copy-a-directory)

```
$fileManager->copyDir('source/directory', 'destination/directory');
```

Copies the entire directory, including subdirectories and files.

---

### **4. Move a File or Directory**

[](#4-move-a-file-or-directory)

```
$fileManager->move('source/file', 'destination/file');
```

Moves or renames a file or directory.

---

### **5. Delete a File or Directory**

[](#5-delete-a-file-or-directory)

```
$fileManager->delete('file/to/delete');
```

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**

[](#6-check-if-a-file-or-directory-exists)

```
if ($fileManager->exists('file/to/check')) {
    echo 'File or directory exists.';
}
```

Returns `true` if the file or directory exists, otherwise `false`.

---

### **7. List Files in a Directory**

[](#7-list-files-in-a-directory)

```
$files = $fileManager->listFiles('directory/to/list');
print_r($files);
```

Lists all files inside the specified directory. It returns an array of file names.

---

### **8. Get File Size**

[](#8-get-file-size)

```
$size = $fileManager->getFileSize('file/to/size');
echo 'File size: ' . $size . ' bytes';
```

Returns the size of the file in bytes.

---

### **9. Delete Multiple Files**

[](#9-delete-multiple-files)

```
$fileManager->deleteMultiple(['file1.txt', 'file2.txt']);
```

Deletes multiple files in one call.

---

**API Reference**
-----------------

[](#api-reference)

### **LiteFS Methods**

[](#litefs-methods)

- `__construct(string $basePath)`: Initializes the `LiteFS` with the specified base directory.
- `createDir(string $path)`: Creates a new directory.
- `copyDir(string $src, string $dest)`: Copies a directory from `src` to `dest`.
- `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**
-------------------------------------

[](#to-do-list-for-litefs-development)

---

### **Features to Add**

[](#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**
----------------

[](#contributing)

If you'd like to contribute to LiteFS, please fork the repository and submit a pull request. Contributions are welcome!

---

**License**
-----------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance47

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a43fe7a3e18de403d271a06d79ddfc576f50433e732eb28b87aeb9c425b6ce8?d=identicon)[AmiRCandy](/maintainers/AmiRCandy)

---

Top Contributors

[![AmiRCandy](https://avatars.githubusercontent.com/u/141684579?v=4)](https://github.com/AmiRCandy "AmiRCandy (5 commits)")

---

Tags

phpfilesystemfiledirectoryfile managerlite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amircandy-litefs/health.svg)

```
[![Health](https://phpackages.com/badges/amircandy-litefs/health.svg)](https://phpackages.com/packages/amircandy-litefs)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
