A Simple and Smart File Storage System in PHP CLI

Project idea
How about a lightweight but smart file storage system? Want to store files without duplicates while still seeing every uploaded filename? And do it all without databases or extra complexity? Easy. To demonstrate this, I built a simple but functional file storage system in PHP CLI. I implemented something similar about 15 years ago in the best CMS, Way To Web 3.0, which I stopped developing seven years ago—but it is still the best. In my subjective opinion.
Back to the storage system. What problems does it solve?
- Files are not duplicated, even if they are uploaded under different names—space savings.
- Thanks to alias.json, you can see all uploaded filenames, so users continue to work with “their” files.
- Files are hashed, so data is not lost or changed—you can verify immutability and detect viruses, malicious code injection, and so on.
- No database is required—just the file system. Fewer technologies means easier setup and management.
- Flexible storage structure—the folders are built from a partitioned SHA-256 hash, so files are distributed automatically and evenly across file-system folders, while folder names remain deterministic. Most importantly, you can build distributed storage: part of the namespace on one server, part on another.