PHPackages                             mongofill/mongofill - 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. mongofill/mongofill

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

mongofill/mongofill
===================

Polyfill of PECL Mongo extension

130150.0k40[16 issues](https://github.com/mongofill/mongofill/issues)[13 PRs](https://github.com/mongofill/mongofill/pulls)PHP

Since Mar 3Pushed 9y ago18 watchersCompare

[ Source](https://github.com/mongofill/mongofill)[ Packagist](https://packagist.org/packages/mongofill/mongofill)[ RSS](/packages/mongofill-mongofill/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Mongofill [![Build Status](https://camo.githubusercontent.com/0bbacc4bac9cf479ab1bfacb57f4f0269b9267d06045631410fa1354d1a5d1cf/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d6f6e676f66696c6c2f6d6f6e676f66696c6c2e706e67)](http://travis-ci.org/mongofill/mongofill)
===================================================================================================================================================================================================================================================================================

[](#mongofill-)

Pure PHP implementation of MongoDB driver, with aim to be a drop-in replacement of the official extension, usable under HHVM runtime.

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

[](#installation)

### Recommended way

[](#recommended-way)

The recommended way of installing is through the [mongofill-hhvm](https://github.com/mongofill/mongofill-hhvm) package as HNI extension of HHVM

```
git clone https://github.com/mongofill/mongofill-hhvm
cd mongofill-hhvm
./build.sh
```

You can read the full instructions at [building-and-installation instructions](https://github.com/mongofill/mongofill-hhvm#building-and-installation) from the HNI package.

### Easy way

[](#easy-way)

The easy way of installing Mongofill is [through composer](http://getcomposer.org). You can see [package information on Packagist.](https://packagist.org/packages/mongofill/mongofill)

```
{
    "require": {
        "mongofill/mongofill": "dev-master"
    }
}
```

> Note: as pure PHP, the phpversion('mongo') will return null and some libraries as Doctrine will not work properly [without modifications](https://github.com/mcuadros/mongodb-odm/commit/b89b21b8dca6a0b545a718f3805248453a27ec3d), so please use the HNI version.

Supported libraries
-------------------

[](#supported-libraries)

You can check the current supported libraries at wiki page [Supported-Libraries](https://github.com/koubas/mongofill/wiki/Supported-Libraries)

Community
---------

[](#community)

You can catch us on IRC on Freenode channel #mongofill

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

[](#contributing)

Please push tests, ensuring compatibility with the official Mongo extension, that are not passing yet, into the "compat/not-passing" branch.

Contributions are greatly appreciated, including corrections of our english ;)

To ensure a consistent code base, you should make sure the code follows the PSR2 coding standards. We suggest use php-cs-fixer with your code before make the pull request with this flags: `php-cs-fixer fix . --level=all`

### Running the PHPUnit tests

[](#running-the-phpunit-tests)

Tests are in the `test` folder. To run them, you need PHPUnit.

```
phpunit --configuration phpunit.xml.dist
```

### Running the native mongo-php-driver tests

[](#running-the-native-mongo-php-driver-tests)

You can find helper script at `test/native/helper.sh`. Your system must have installed: mongodb, git, phpize and autotools

```
cd tests/native/
./helper.sh setup
./helper.sh boot
./helper.sh run
```

Benchmarking
------------

[](#benchmarking)

A small suite of benchmarking is included with the package, you can run the suite with this command:

```
php ./vendor/bin/athletic -b tests/bootstrap.php  -p tests/Mongofill/Benchmarks/
```

Some results can be find at:

Caveats
-------

[](#caveats)

### Replica Sets &amp; APC

[](#replica-sets--apc)

When using a replica set, the Mongofill driver needs to fetch information about the replica set configuration and status. To improve performance, the driver will attempt to use APC (apc\_fetch, apc\_store) to cache replica set data.

The APC functions should be automatically installed with HHVM, but if you plan on using the Mongofill driver with PHP, you'll need to make sure APC is installed if you want the performance boost.

For PHP 5.5 and higher, this would be the APCu extension. If APC is not installed, replica sets will still function, they just won't be as fast.

###  Health Score

35

—

LowBetter than 81% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7552adf30bc492eee5cf3698c18bd13963d9fefe3364b69c1a226d22e6cfcfa?d=identicon)[koubas](/maintainers/koubas)

---

Top Contributors

[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (112 commits)")[![koubas](https://avatars.githubusercontent.com/u/1354930?v=4)](https://github.com/koubas "koubas (36 commits)")[![dylanwenzlau](https://avatars.githubusercontent.com/u/4359148?v=4)](https://github.com/dylanwenzlau "dylanwenzlau (17 commits)")[![Pomyk](https://avatars.githubusercontent.com/u/156784?v=4)](https://github.com/Pomyk "Pomyk (12 commits)")[![endeveit](https://avatars.githubusercontent.com/u/197781?v=4)](https://github.com/endeveit "endeveit (3 commits)")[![nantunes](https://avatars.githubusercontent.com/u/209365?v=4)](https://github.com/nantunes "nantunes (3 commits)")[![thawkins](https://avatars.githubusercontent.com/u/14537?v=4)](https://github.com/thawkins "thawkins (3 commits)")[![Kozzi11](https://avatars.githubusercontent.com/u/1239642?v=4)](https://github.com/Kozzi11 "Kozzi11 (2 commits)")[![rexxars](https://avatars.githubusercontent.com/u/48200?v=4)](https://github.com/rexxars "rexxars (2 commits)")[![nbas11](https://avatars.githubusercontent.com/u/454696?v=4)](https://github.com/nbas11 "nbas11 (2 commits)")[![tstobbe](https://avatars.githubusercontent.com/u/847910?v=4)](https://github.com/tstobbe "tstobbe (1 commits)")[![EmmanuelVella](https://avatars.githubusercontent.com/u/663607?v=4)](https://github.com/EmmanuelVella "EmmanuelVella (1 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![iamdaniele](https://avatars.githubusercontent.com/u/208292?v=4)](https://github.com/iamdaniele "iamdaniele (1 commits)")[![JohanTan](https://avatars.githubusercontent.com/u/4358690?v=4)](https://github.com/JohanTan "JohanTan (1 commits)")[![mkeen](https://avatars.githubusercontent.com/u/38221?v=4)](https://github.com/mkeen "mkeen (1 commits)")[![MobDev-Hobby](https://avatars.githubusercontent.com/u/1918932?v=4)](https://github.com/MobDev-Hobby "MobDev-Hobby (1 commits)")[![rybakit](https://avatars.githubusercontent.com/u/533861?v=4)](https://github.com/rybakit "rybakit (1 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k280.5M5.5k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k114.4M86](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k51.5M8.1k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k62.7M487](/packages/mongodb-mongodb)[spatie/laravel-translatable

A trait to make an Eloquent model hold translations

2.4k22.1M345](/packages/spatie-laravel-translatable)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.5k23.2M24](/packages/kirschbaum-development-eloquent-power-joins)

PHPackages © 2026

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