1
1
MongoDB
2
2
=======
3
3
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/
6
22
7
23
Building
8
24
--------
9
25
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
+
10
49
Compiling this extension requires the ``hphpize `` command, which is available by
11
50
installing the ``hhvm-dev `` package from the
12
51
`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::
31
70
make -j 5
32
71
make install
33
72
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
+ -------------
36
84
37
85
To run the rests::
38
86
39
87
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