PHPackages                             darkotodoric/efficient-file-management - 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. darkotodoric/efficient-file-management

ActiveLibrary

darkotodoric/efficient-file-management
======================================

PHP-based file management system designed for seamless storage and retrieval of large volumes of files with optimal performance

v1.0(2y ago)23MITPHPPHP &gt;=7.4

Since Jan 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/darkotodoric/efficient-file-management)[ Packagist](https://packagist.org/packages/darkotodoric/efficient-file-management)[ Docs](https://github.com/darkotodoric/efficient-file-management)[ RSS](/packages/darkotodoric-efficient-file-management/feed)WikiDiscussions main Synced 1mo ago

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

Efficient File Management
=========================

[](#efficient-file-management)

[![Packagist License](https://camo.githubusercontent.com/bbb63b2ef0b02755f557c3bf5023033205c8cd3f430a0bce97f8c35eded0aa43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6461726b6f746f646f7269632f656666696369656e742d66696c652d6d616e6167656d656e74)](https://camo.githubusercontent.com/bbb63b2ef0b02755f557c3bf5023033205c8cd3f430a0bce97f8c35eded0aa43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6461726b6f746f646f7269632f656666696369656e742d66696c652d6d616e6167656d656e74)[![Packagist Version](https://camo.githubusercontent.com/f0d44acb257b5bc705b7e195add9e83ecf4cbdbeedc157e7c1b6b50429312d8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b6f746f646f7269632f656666696369656e742d66696c652d6d616e6167656d656e74)](https://camo.githubusercontent.com/f0d44acb257b5bc705b7e195add9e83ecf4cbdbeedc157e7c1b6b50429312d8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b6f746f646f7269632f656666696369656e742d66696c652d6d616e6167656d656e74)

The `EfficientFileManagement` class is a highly efficient PHP solution for managing and storing an extensive number of files, potentially in the order of billions, while maintaining exceptional performance. It achieves this scalability by organizing files into a hierarchical folder structure based on unique IDs (from database or any other source) and file extensions.

Installation
------------

[](#installation)

Install the latest version with:

```
$ composer require darkotodoric/efficient-file-management
```

Usage
-----

[](#usage)

```
require_once 'vendor/autoload.php';

// Define the folder path where files will be saved
$baseFolderPath = '/mnt/efficient-file-management/';

// Define allowed extensions
$allowedExtensions = ['json', 'xml', 'txt'];

// Define the division number (Maximum number of files in one folder)
$divisionNumber = 50000;

$efficientFileManagement = new EfficientFileManagement($baseFolderPath, $allowedExtensions, $divisionNumber);

// Get IDs from MySQL or other data source
$ids = [1337, 5162, 70312, 155312, 160312, 525312];

// Save content
foreach ($ids as $id) {
    $data = json_encode(['name' => 'File with ID ' . $id]);
    $efficientFileManagement->saveContent($id, 'json', $data);
}

// Get content
foreach($ids as $id){
    $data = $efficientFileManagement->getContent($id, 'json');
}

// Delete content
foreach($ids as $id){
    $data = json_encode(['name' => 'File with ID ' . $id]);
    $efficientFileManagement->deleteContent($id, 'json');
}
```

Folder and file structures
--------------------------

[](#folder-and-file-structures)

Here's an example of how the folder structure and files might look when using the `EfficientFileManagement` class to store files with IDs and extensions: Suppose we have the following files:

- File with ID `123456`, `987654`, `555555` and extension `json`
- File with ID `987654` and extension `xml`
- File with ID `555555` and extension `txt`

The resulting folder structure might look like this:

```
/mnt/efficient-file-management/
    ├── json/
    │   ├── 2/
    │   │   └── 123456.json
    │   ├── 19/
    │   │   └── 987654.json
    │   ├── 11/
    │   │   └── 555555.json
    ├── xml/
    │   ├── 19/
    │   │   └── 987654.xml
    ├── txt/
    │   ├── 11/
    │   │   └── 555555.txt

```

In this structure:

- Files with the `.json` extension are stored in the `json` folder.
- Files with the `.xml` extension are stored in the `xml` folder.
- Files with the `.txt` extension are stored in the `txt` folder.
- Each folder is further organized into subfolders based on the integer division of the file's ID by 50000. This hierarchical organization ensures that even with a vast number of files, the system remains efficient and easily manageable.

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

846d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81c3430f06635e65f8d00ae2a4c457240949e44b38477909deff075c1e225c36?d=identicon)[darkotodoric](/maintainers/darkotodoric)

---

Top Contributors

[![darkotodoric](https://avatars.githubusercontent.com/u/7748474?v=4)](https://github.com/darkotodoric "darkotodoric (9 commits)")

---

Tags

file-managementphpphpfile management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/darkotodoric-efficient-file-management/health.svg)

```
[![Health](https://phpackages.com/badges/darkotodoric-efficient-file-management/health.svg)](https://phpackages.com/packages/darkotodoric-efficient-file-management)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

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