MongoDB PHP extension 1.7.0 released

The PHP team is happy to announce that version 1.7.0 of the mongodb PHP extension is now available on PECL.

Release Highlights

This release introduces classes and options to enable Client-Side Field Level Encryption. With this feature, sensitive data can be automatically encrypted (MongoDB Enterprise Edition only) or explicitly encrypted using the MongoDB\Driver\ClientEncryption API. If the extension is compiled against system libraries, libmongocrypt must be installed for this feature to be enabled. The --with-mongodb-client-side-encryption configure switch can be used to control compilation of encryption features.

MongoDB\Driver\BulkWrite::update now supports a hint option, which can be used with MongoDB 4.2 or later.

MongoDB\Driver\ReadConcern, ReadPreference, and WriteConcern instances now support PHP serialization. All classes in the MongoDB\BSON namespace can now be cloned.

The MongoDB\Driver\ReadPreference class now exposes the read preference mode as a string through the getModeString method. This is preferred over calling getMode, which will be deprecated in a future release.

MongoDB\Driver\Session now exposes more detailed transaction information. Instead of only exposing whether a transaction is running, the current state of the transaction can now be obtained using the getTransactionState method. The getTransactionOptions method returns an array of options that the current transaction is using, based on options passed when creating the session object and starting the transaction.

When forking a process that is using a MongoDB\Driver\Manager instance, the underlying libmongoc client is now reset on the first operation in the child process. This prevents an issue where exiting the child can destroy cursors that the parent process may still be using.

Specifying any SSL or TLS option via the driverOptions parameter for MongoDB\Driver\Manager::__construct will now implicitly enable TLS, as is done for the corresponding URI options.

The wTimeout parameter for MongoDB\Driver\WriteConcern::__construct now accepts 64-bit values. On 32-bit systems, MongoDB\Driver\WriteConcern::getWtimeout will return a MongoDB\BSON\Int64 instance if the WriteConcern object was created with a wTimeout that exceeds the 32-bit range. On 64-bit systems, this method will always return an integer value.

The --with-libbson and --with-libmongoc configure switches have been deprecated. The new --with-mongodb-system-libs configure option should be used to enable compiling against system libraries instead of bundled versions of libbson, libmongoc, and libmongocrypt. The extension continues to use bundled libraries by default.

This release updates the bundled libbson and libmongoc libraries to 1.16.0. The bundled libmongocrypt library is version 1.0.1.

Please note that this is the last minor release series that is compatible with PHP 5. Support for PHP 5 will be dropped in the upcoming 1.8.0 release.

A complete list of resolved issues in this release may be found at: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12484&version=24297

Documentation

Documentation is available on PHP.net:
http://php.net/set.mongodb

Feedback

We would appreciate any feedback you might have on the project:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12484&issuetype=6

Installation

You can either download and install the source manually, or you can install the extension with:

pecl install mongodb

or update with:

pecl upgrade mongodb

Windows binaries are available on PECL:
http://pecl.php.net/package/mongodb

1 Like