MongoDB HHVM driver **Note, this driver is no longer maintained**
PHP C++ Hack Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.scripts HHVM-286: Make HHVM tests run on Travis Apr 3, 2017
benchmarks Only do the simple test, so that the memory leak issue can be shared … Mar 2, 2016
libbson @ 3e7b18a HHVM-227: Driver should validate BSON documents before insert and update Apr 4, 2017
libmongoc @ 7eb1204 HHVM-227: Driver should validate BSON documents before insert and update Apr 4, 2017
scripts HHVM-248: Validate that read preference tags is an array of documents Sep 20, 2016
src/MongoDB HHVM-291: Add MongoDB\BSON\toExtendedJSON() to wrap bson_as_extended_… Apr 6, 2017
tests Merge branch 'v1.2' Apr 24, 2017
.gitignore HHVM-190: Implement APM Specification Mar 31, 2017
.gitmodules Update libmongoc to 1.2.0-dev (with SDAM) May 8, 2015
.travis.yml HHVM-286: Make HHVM tests run on Travis Apr 3, 2017
CONTRIBUTING.rst HHVM-136: Make hippo and phongo README/CONTRIBUTING files consistent Nov 12, 2015
ChangeLog.rst Go with 1.2.1 Jan 17, 2017
LICENSE Add Apache 2 license Dec 19, 2014
README.rst Added note that the driver is no longer maintained. Jun 2, 2017
THIRD_PARTY_NOTICES HHVM-256: Third party notices Nov 28, 2016
bson.cpp Merge branch 'v1.2' Apr 22, 2017
bson.h HHVM-177: CursorId should serialize to BSON as 64-bit integer Mar 31, 2017
config.cmake Upgrading libmongoc to 1.7.0-dev Apr 4, 2017
ext_mongodb.php HHVM-291: Add MongoDB\BSON\toExtendedJSON() to wrap bson_as_extended_… Apr 6, 2017
mongodb.cpp HHVM-291: Add MongoDB\BSON\toExtendedJSON() to wrap bson_as_extended_… Apr 6, 2017
mongodb.h Make things compile with both HHVM 3.8 and 3.9(dev) Jul 29, 2015
pool.cpp HHVM-244: Remove "#undef TRACE" clutch Mar 28, 2017
pool.h HHVM-123: Persist connections and SDAM status between requests Apr 28, 2016
run-tests.php Show test counter even if we only show certain result groups Sep 3, 2015
serialization.rst Merge branch 'v1.2' Oct 17, 2016
test.sh Initial commit Dec 10, 2014
tutorial.rst Update GitHub URLs for org change and repo rename Oct 23, 2015
utils.cpp Fixed a few missing validations Apr 4, 2017
utils.h HHVM-254: Upgrade libbson and libmongoc to 1.5.0 (currently -rc0) Sep 26, 2016

README.rst

MongoDB

Note: This driver is no longer maintained. Please read the announcement.

This is the low-level HHVM driver for MongoDB. The API is the same as the PHP driver for MongoDB. The documentation for both of them is the same, and can be found at http://www.php.net/manual/en/set.mongodb.php

The driver is written to be a bare bone layer to talk to MongoDB, and therefore misses many convenience features. Instead, these convenience methods have been split out into a layer written in PHP, the MongoDB Library. Using this library should be your preferred way of interacting with MongoDB.

Please note that the new HHVM and PHP drivers implement a different API from the legacy driver at http://pecl.php.net/package/mongo; therefore existing libraries that use the legacy driver (e.g. Doctrine MongoDB's ODM) will not work with the new drivers.

In the long run, we hope that userland packages will be built atop this driver to implement various APIs (e.g. a BC layer for the existing driver, new fluent interfaces), management utilities (for creating admin utilities and cluster management applications), and other interesting libraries.

Documentation

Installation

Please ensure, that before you install the extension, the following tools are installed: autoconf, automake, and libtool.

Compiling this extension requires the hphpize command, which is available by installing the hhvm-dev package from the HHVM repositories or building HHVM from source.

Besides the extension, we recommend using it in combination with our userland library which is distributed as mongodb/mongodb for Composer.

From a package (.tgz)

Releases of this driver can be found on https://github.com/mongodb/mongo-hhvm-driver/releases

Please download the latest .tgz file into a directory, and run the following commands:

mkdir hhvm-mongodb
cd hhvm-mongodb
tar -xvzf ../hhvm-mongodb-1.1.2.tgz
cd hhvm-mongodb-1.1.2
hphpize
cmake .
make configlib
make -j [number_of_processor_cores] # eg. make -j 4
make install

Building from source

Run the following commands:

git clone https://github.com/mongodb/mongo-hhvm-driver --branch master
cd mongo-hhvm-driver/
git submodule update --init --recursive
hphpize
cmake .
make configlib
make -j [number_of_processor_cores] # eg. make -j 4
make install

Installing

In your /etc/hhvm/php.ini, add the following lines (adjusting paths if necessary):

hhvm.dynamic_extensions[mongodb]=mongodb.so

Contributing

See CONTRIBUTING.rst.

Related Projects