Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit c2dd68c

Browse files
committed
Update readme
1 parent 8ff8c1b commit c2dd68c

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

README.rst

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,51 @@
11
MongoDB
22
=======
33

4-
This is a proof-of-concept HHVM extension mimicking the proof-of-concept PHP
5-
extension "phongo".
4+
This is the low-level HHVM driver for MongoDB. It implements the same
5+
interface as the PHP driver for MongoDB that you will find at
6+
https://pecl.php.net/package/mongodb. The documentation for both of them is
7+
therefore (mostly) the same, and can be found at
8+
http://docs.php.net/manual/en/set.mongodb.php
9+
10+
The driver is written to be a bare bone layer to talk to MongoDB, and
11+
therefore misses many convenience features. Instead, these convenience methods
12+
have been split out into a layer written in PHP, the `MongoDB Library`_.
13+
Using this library should be your preferred way of interacting with MongoDB.
14+
15+
Please note that the new HHVM and PHP drivers implement a different API from
16+
the legacy driver at http://pecl.php.net/package/mongo, and hence, you will
17+
find it hard for other libraries like `Doctrine MongoDB's ODM`_ will not work
18+
with the new drivers.
19+
20+
.. _`Doctrine MongoDB's ODM`: http://doctrine-mongodb-odm.readthedocs.org/en/latest/
21+
.. _`MongoDB Library`: http://mongodb-labs.github.io/mongo-php-library-prototype/
622

723
Building
824
--------
925

26+
From a package (.tgz)
27+
~~~~~~~~~~~~~~~~~~~~~
28+
29+
Releases of this driver can be found on
30+
https://s3.amazonaws.com/drivers.mongodb.org/hhvm/index.html
31+
32+
Please download the latest .tgz file into a directory, and run the following
33+
commands::
34+
35+
mkdir hhvm-mongodb
36+
cd hhvm-mongodb
37+
tar -xvzf ../hhvm-mongodb-1.0alpha1
38+
cd hhvm-mongodb-1.0alpha1
39+
cd libbson; ./autogen.sh; cd ..
40+
cd libmongoc; ./autogen.sh; cd ..
41+
hphpize
42+
cmake .
43+
make -j 16
44+
make install
45+
46+
From source
47+
~~~~~~~~~~~
48+
1049
Compiling this extension requires the ``hphpize`` command, which is available by
1150
installing the ``hhvm-dev`` package from the
1251
`HHVM repositories <https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-for-HHVM>`_
@@ -31,10 +70,19 @@ After cloning the repository, the extension may be built like so::
3170
make -j 5
3271
make install
3372

34-
Running
35-
-------
73+
Installing
74+
----------
75+
76+
In your ``/etc/hhvm/php.ini``, add the following lines (adjusting paths if
77+
necessary)::
78+
79+
hhvm.dynamic_extension_path=/usr/local/hhvm/3.9.1/lib/hhvm/extensions/20150212
80+
hhvm.dynamic_extensions[mongodb]=mongodb.so
81+
82+
Running Tests
83+
-------------
3684

3785
To run the rests::
3886

3987
export TEST_PHP_EXECUTABLE=`which hhvm`
40-
hhvm -vDynamicExtensions=mongodb.so run-tests.php
88+
hhvm -vDynamicExtensions.0=/usr/local/hhvm/3.9.1/lib/hhvm/extensions/20150212/mongodb.so run-tests.php

0 commit comments

Comments
 (0)