Skip to content
This repository has been archived by the owner on Feb 20, 2018. It is now read-only.

Latest commit

 

History

History
63 lines (37 loc) · 2.21 KB

README.md

File metadata and controls

63 lines (37 loc) · 2.21 KB

Mongofill for HHVM Build Status

This package provides a drop-in replacement of the official mongodb extension, as a HNI extension to be executed under HHVM runtime

The BSON encode and decode functions are implemented in C++ and the rest of the interface is in pure PHP thanks to Mongofill.

This HNI implementation is 3-5 times faster than the original mongofill extension in pure PHP, too provide a working phpversion("mongo") under HHVM, returning 1.4.5, missed in the original mongofill.

Building and Installation

Installation requires hhvm-dev package to be installed. Alternatively a copy of HHVM can be built from source on the local machine; instructions on how to do this are available on the HHVM Wiki.

The library libbson is required to be installed in the system, you can follow the instructions in the libbson repository.

Once done, the following commands will build the extension.

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

This will produce a mongo.so file, the dynamically-loadable extension.

To enable the extension, you need to have the following section in your hhvm config file

hhvm.dynamic_extension_path = /path/to/hhvm/extensions
hhvm.dynamic_extensions[mongo] = mongo.so

Supported libraries

You can check the current supported libraries at wiki page Supported-Libraries

Community

You can catch us on IRC on Freenode channel #mongofill

Benchmarking

A small suite of benchmarking is included with the mongofill 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: https://gist.github.com/mcuadros/9551290

License

MIT, see LICENSE