The PHP team is happy to announce that version 0.3.1-alpha of our new
"mongodb" PHP extension is now available on PECL[1].
The "mongodb" extension is an entirely new project, which is built
upon libbson[2] and libmongoc[3] (i.e. our C driver). This new
extension shares no code with our current, stable driver[4], which
will continue to be maintained for the foreseeable future.
This is our third alpha release and is the first to include Windows
compatibility. Initial documentation for the extension may be found on
PHP.net:
http://php.net/set.mongodb
This extension provides a low-level API for the most essential
functionality (e.g. queries, commands, write operations). Ultimately,
we expect developers to use this extension with a higher-level PHP
library, such as our mongo-php-library-prototype[5] project, which
provides a full-featured API (e.g. CRUD methods and convenience
methods for commands). For additional information about the
architecture behind our new drivers and library, please see this blog
post:
http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers
Lastly, the extension also includes our first implementation of an
object-document serializer, which allows PHP objects (i.e. model
classes) to be persisted to MongoDB, and hydrated back into objects
after querying. An introduction to this feature can be found here:
http://10gen-labs.github.io/mongo-php-driver-prototype/ods/
To install the new extension:
$ pecl install mongodb-alpha
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded
Configuration" | sed -e "s|.*:\s*||"`
Windows binaries are available on PECL:
http://pecl.php.net/package/mongodb
As the "mongodb" extension is under heavy development, we would
appreciate any feedback you might have on the project:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12484&issuetype=6
[1]
http://pecl.php.net/package/mongodb
[2]
https://github.com/mongodb/libbson
[3]
https://github.com/mongodb/mongo-c-driver
[4]
http://pecl.php.net/package/mongo
[5]
https://github.com/10gen-labs/mongo-php-library-prototype