MongoDB PHP Driver 1.2.0 released

13 views
Skip to first unread message

Jeremy Mikola

unread,
Nov 29, 2016, 11:19:38 AM11/29/16
to mongod...@googlegroups.com, mongodb-...@googlegroups.com
The PHP team is happy to announce that version 1.2.0 of our new mongodb PHP extension is now available on PECL. This release adds support for new features in MongoDB 3.4.

Release Highlights

This release supports new features of MongoDB 3.4, such as collation, the Decimal128 BSON type, and the handshake protocol to assist with server-side connection debugging.

It contains a significant amount of internal refactoring to remove our dependence on libmongoc's private API, which is good news for users who install the driver through their OS package manager (e.g. CentOS, Debian).

This release includes two significant changes related to how the driver communicates with a server and persists connections across requests (within a PHP worker process). Integration with PHP's streams API has been removed and the driver now relies on libmongoc for all socket communication, which should resolve some issues with connection and socket timeouts not being correctly applied. While previous versions of the driver persisted individual sockets across requests (based on host, port, and URI string), the driver now persists the entire libmongoc client object and its sockets (based on Manager constructor arguments). This means that SSL sessions and topology states will now be preserved across requests (i.e. the driver will not issue a flurry of isMaster commands to re-discover the topology on each request). See Connection Handling in the driver documentation for more information.

Internal changes aside, this release also includes a number of usability improvements. All BSON classes now support PHP serialization via serialize(), JSON serialization via json_encode() and PHP's JsonSerializable interface, and var_export().

The UTCDateTime constructor now defaults to the current time if no argument is provided and can also accept a DateTimeInterface instance.

The Binary and Javascript types now have __toString() methods that return their binary data and code strings, respectively. The JavaScript class also has new getCode() and getScope() methods, which were curiously absent in previous versions.

The ObjectID class now has a getTimestamp() helper method, which returns the 4-byte timestamp component of an ObjectID as an integer.

The Regex constructor's second $flags parameter is now optional and defaults to an empty string. Flags are now sorted alphabetically when a Regex is constructed.

The Query constructor, BulkWrite::update(), and BulkWrite::delete() now accept a "collation" document option, which can be used to specify a locale-aware string comparison or sort order. See Collation in the MongoDB manual for additional information.

Read preferences now support a "maxStalenessSeconds" integer option, which can be used with modes other than "primary" to specify an acceptable replication delay for secondary servers (see: SERVER-12861). The "maxStalenessSeconds" option may also be used in the connection URI or options array provided to the Manager constructor to configure the default read preference.

This release upgrades our libbson and libmongoc dependencies to 1.5.0.

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

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
Reply all
Reply to author
Forward
0 new messages