PHPackages                             alexander-mitov/mongo-filesystem - 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. [Database &amp; ORM](/categories/database)
4. /
5. alexander-mitov/mongo-filesystem

ActiveLibrary[Database &amp; ORM](/categories/database)

alexander-mitov/mongo-filesystem
================================

Implementation of a filesystem on top of MongoDB

v1.0.4(11y ago)429Apache-2.0PHPPHP &gt;=5.4.0

Since May 11Pushed 11y ago2 watchersCompare

[ Source](https://github.com/AlexanderMitov/MongoFilesystem)[ Packagist](https://packagist.org/packages/alexander-mitov/mongo-filesystem)[ Docs](https://github.com/AlexanderMitov/MongoFilesystem)[ RSS](/packages/alexander-mitov-mongo-filesystem/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

MongoFilesystem
===============

[](#mongofilesystem)

An implementation in PHP of a hierarchical file system using MongoDB as a storage engine. The library uses the MongoDB GridFS programming interface for storing the files and a standard collection for the folder information. There is an Object-oriented representation of the folders and files in the MongoFilesystem and rich API for performing operations on them. There are file/folder renderers for JSON/HTML/XML as well.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4.0
- MongoDB PHP Driver &gt;= 1.4.0
- PHP SimpleXML extension
- You need the PHP Zip extension &gt;= 1.1.0 in order to use the folder zipping functionality

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

[](#installation)

1. Install Composer .
2. Add to your composer.json: ```
        "alexander-mitov/mongo-filesystem": "1.0.*"
    }```

    ```
3. Run the `composer install` command.

Basic usage
-----------

[](#basic-usage)

Look at the demo project: [https://github.com/AlexanderMitov/Demo\_Project\_Of\_MongoFilesystem](https://github.com/AlexanderMitov/Demo_Project_Of_MongoFilesystem)

Tips
----

[](#tips)

Getting a folder from the MongoFilesystem (or from the local fs using \\MongoFilesystem\\File) means that all its subfolders and subfolders of subfolders and so on are recursively/iteratively traversed. This is a nice convinience when performing upload/update/delete oprations on a folder or a certain action to its subfolders but it won't be optimal for cases when you need just the name or other property of the folder. In such cases set the second parameter of `\MongoFilesytem::getFolder()` to false in order to avoid traversing subfolders. This also means that you should NOT perform upload/update/delete operations on a folder with unset subfolders for obvious reasons.

API
---

[](#api)

- MongoFilesystem::\_\_construct(MongoDB)
- MongoFilesystem::createFolder(string, string)
- MongoFilesystem::deleteFile(MongoFile)
- MongoFilesystem::deleteFolder(MongoFolder)
- MongoFilesystem::downloadAndOutputFile(MongoFile)
- MongoFilesystem::downloadAndOutputFolder(MongoFolder, boolean)
- MongoFilesystem::downloadFile(MongoFile)
- MongoFilesystem::downloadFileInFile(MongoFile)
- MongoFilesystem::downloadFileInFolder(MongoFile, string)
- MongoFilesystem::downloadFolderInFile(MongoFolder, string)
- MongoFilesystem::downloadFolderInFolder(MongoFolder, string)
- MongoFilesystem::fileWithIDExists(MongoId)
- MongoFilesystem::fileWithNameExistsInFolder(string, string, MongoId)
- MongoFilesystem::fileWithPathExists(string, string)
- MongoFilesystem::filesAreIdentical(MongoId, File)
- MongoFilesystem::folderWithIDExists(MongoId)
- MongoFilesystem::folderWithNameAndParentFolderIDExists(string, MongoId)
- MongoFilesystem::folderWithNameExistsInFolder(string, MongoId)
- MongoFilesystem::folderWithPathExists(string, string)
- MongoFilesystem::getFile(MongoId)
- MongoFilesystem::getFileByNameAndParentFolderID(string, string, MongoId)
- MongoFilesystem::getFileByPath(string, string)
- MongoFilesystem::getFileIDByNameAndParentFolderID(string, string, MongoId)
- MongoFilesystem::getFileIDByPath(string, string)
- MongoFilesystem::getFilePath(MongoFile, boolean, string)
- MongoFilesystem::getFileResourceStream(MongoId)
- MongoFilesystem::getFolder(MongoId, boolean)
- MongoFilesystem::getFolderByNameAndParentFolderID(string, MongoId)
- MongoFilesystem::getFolderByPath(string, string)
- MongoFilesystem::getFolderByPath(string, string)
- MongoFilesystem::getFolderFiles(MongoId)
- MongoFilesystem::getFolderIDByNameAndParentFolderID(string, MongoId)
- MongoFilesystem::getFolderIDByPath(string, string)
- MongoFilesystem::getFolderParentFolderID(MongoId)
- MongoFilesystem::getFolderPath(MongoId, boolean, string)
- MongoFilesystem::getFolderSubfolders(MongoId)
- MongoFilesystem::getParentFolder(mixed)
- MongoFilesystem::moveFileInFolder(MongoId, MongoId)
- MongoFilesystem::moveFolderInFolder(MongoId, MongoId)
- MongoFilesystem::renameFile(MongoId, string, string)
- MongoFilesystem::renameFolder(MongoId, stirng)
- MongoFilesystem::updateFile(MongoId, File)
- MongoFilesystem::updateFolder(MongoId, Folder)
- MongoFilesystem::uploadFile(File, MongoId, boolean)
- MongoFilesystem::uploadFolder(Folder, MongoId)
- MongoFilesystem::uploadRecursivelyFolder(Folder, MongoId)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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

Every ~1 days

Total

6

Last Release

4373d ago

Major Versions

v0.0.1beta → v1.0.0beta2014-05-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a7021b2d3b92096fe902ffe38e363270080def12bed46cdc5b81af5157bc847?d=identicon)[AlexMitov](/maintainers/AlexMitov)

---

Top Contributors

[![aleksmitov](https://avatars.githubusercontent.com/u/1766321?v=4)](https://github.com/aleksmitov "aleksmitov (48 commits)")[![AlexanderMitov](https://avatars.githubusercontent.com/u/141412588?v=4)](https://github.com/AlexanderMitov "AlexanderMitov (2 commits)")

---

Tags

database

### Embed Badge

![Health badge](/badges/alexander-mitov-mongo-filesystem/health.svg)

```
[![Health](https://phpackages.com/badges/alexander-mitov-mongo-filesystem/health.svg)](https://phpackages.com/packages/alexander-mitov-mongo-filesystem)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k241.3M3.3k](/packages/doctrine-doctrine-bundle)[doctrine/data-fixtures

Data Fixtures for all Doctrine Object Managers

2.9k136.1M516](/packages/doctrine-data-fixtures)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M186](/packages/spatie-laravel-backup)[maxmind-db/reader

MaxMind DB Reader API

69799.2M47](/packages/maxmind-db-reader)[spatie/db-dumper

Dump databases

1.2k25.9M69](/packages/spatie-db-dumper)

PHPackages © 2026

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