Skip to content

Releases: mongodb/mongo-php-driver

1.1.0

15 Dec 18:49
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.1.0 of our new mongodb PHP extension is now available on PECL. This release adds support for new features in MongoDB 3.2.

Release Highlights

MongoDB\Driver\BulkWrite now supports a bypassDocumentValidation option, which may be used to control how document validation is enforced for insert and update operations. For more information on this feature, see Document Validation in the MongoDB 3.2 release notes.

A new MongoDB\Driver\ReadConcern class has also been introduced, instances of which may be passed as a readConcern option to MongoDB\Driver\Query to control the isolation level of queries. For more information on this feature, see Read Concern in the MongoDB 3.2 release notes.

This release also bumps our libmongoc and libbson dependencies to 1.3.0.

A complete list of resolved issues in this release may be found at:
https://github.com/mongodb/mongo-php-driver/blob/master/RELEASE-1.1

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

Thanks

Thanks for our community contributors for 1.1.0:

  • Jorgen Evens

1.0.1

07 Dec 22:51
Compare
Choose a tag to compare

This is the first bug fix release of the 1.0 series of the MongoDB PHP Driver.

Release Highlights

This release fixes a logical issue in the check_closed stream handler, which may have previously reported an open stream as closed and thrown an exception.

A complete list of resolved issues in this release may be found at:
https://github.com/mongodb-labs/mongo-php-driver-prototype/blob/v1.0/RELEASE-1.0

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.0.0

02 Nov 20:19
Compare
Choose a tag to compare

The PHP team is delighted to announce that version 1.0.0 of our new mongodb PHP extension is now available on PECL. This stable 1.0.0 release is the culmination of more than one year of active development and represents a substantial evolution in the PHP driver's architecture.

Introduction

This extension is written atop libmongoc and libbson, and purposefully offers a basic API for core functionality (e.g. connection handling, queries, commands, write operations, and BSON serialization). Additional functionality is left to be implemented by userland libraries, such as our mongo-php-library. Our hope is that this separation of concerns will keep the driver lightweight (and fast), easier to maintain, and make it an ideal starting point for constructing your own framework or library. If you are building an application with MongoDB, we would suggest that you use this driver in conjunction with the higher-level mongo-php-library.

For a more detailed explanation of our new architecture, see the following article on the MongoDB blog, which was published earlier this year:
https://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers

Compatibility

This initial release provides compatibility with MongoDB 2.4 through 3.0 and PHP 5.4 through 5.6 (PHP 7 is scheduled for 1.1.0). Support for Facebook's HHVM runtime will be provided by mongo-hhvm-driver, which implements the same public API found in this extension. A common API means that mongo-php-library is compatible with both this extension and its HHVM counterpart.

This driver implements several new MongoDB driver specifications, such as Server Discover and Monitoring and Server Selection. Higher-level specifications, such as our CRUD API, are implemented in mongo-php-library.

Improvements

  • More concise API (e.g. command helpers are now left to userland libraries)
  • Direct access to individual server connections
  • Compatibility with cross-driver specifications
  • Richer BSON handling (e.g. extended JSON, ODM functionality)

BSON handling has improved considerably from our legacy driver. Users now have much more control over how BSON arrays and documents are unserialized into PHP values (e.g. PHP arrays, stdClass objects, or custom classes via built-in ODM functionality). This eliminates a significant shortcoming of the legacy driver, where PHP arrays were used exclusively.

More information on these BSON improvements may be found in the following documentation:

Overview

The 1.0.0 release implements a brand new API and is a significant departure from our legacy driver. The new driver provides several new core classes:

Additionally, there are several new value objects:

BSON interfaces and classes may be found under the MongoDB\BSON namespace.

Queries, commands, and write operations may be executed via the following methods on the MongoDB\Driver\Manager class:

These methods also exist on the MongoDB\Driver\Server class, for lower-level control over exactly which server handles the operation.

Changes from our legacy mongo extension

Most significantly, the legacy driver's MongoClient, MongoDB, and MongoCollection classes have been obsoleted by the MongoDB\Driver\Manager class, which is the new gateway for connecting and executing queries, commands, and write operations.

Two significant behavioral changes between the legacy and new driver are:

  • Unlike MongoCursor in the legacy driver, which had pre- and post-executed states and could be rewound to re-execute a query, MongoDB\Driver\Cursor always corresponds to results of an executed command or query and may only be iterated once.
  • The new driver unserializes BSON documents (both root and embedded) as stdClass objects by default (compared to PHP arrays in the legacy driver). This behavior may be customized via the setTypeMap() method on MongoDB\Driver\Cursor and is discussed in more detail in the BSON persistence documentation.

Note: mongo-php-library does provide client, database, and collection classes, which resemble the like-named classes in our legacy driver; however, while these new classes are mostly equivalent, some command helper methods have not been reimplemented and public APIs in the library have changed to ensure compatibility with current specifications such as the CRUD API.

What is the status of the legacy mongo extension?

The mongodb extension supersedes our legacy mongo extension.

We plan to continue supporting our existing mongo driver with critical bug fixes and maintenance releases; however, it will no longer be actively developed with new functionality (e.g. support for HHVM, PHP 7, or MongoDB 3.2).

Roadmap

We expect to add support for PHP 7 and MongoDB 3.2 in forthcoming 1.1.0 and 1.2.0 releases, respectively. Future development may be tracked in our public PHPC JIRA project.

In the more immediate future, you can expect 1.0.0 releases of mongo-hhvm-driver (currently available in as 1.0.0RC1) and mongo-php-library (currently 1.0.0-beta1), which are tracked in our HHVM and PHPLIB JIRA projects, respectively.

GridFS will be implemented entirely in our userland API and is planned for mongo-php-library 1.1.0.

Documentation

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

Additionally, the GitHub repository contains additional documentation on common use cases, such as executing queries, commands, and write operations:
http://mongodb.github.io/mongo-php-driver/

Feedback

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

Installation

The extension may be installed via PECL:

pecl install mongodb

If you've previously installed the extension, you may update it with:

pecl upgrade mongodb

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

🐘 Thanks

Thanks for everyone who contributed along the way to 1.0.0:

  • Remi Collet
  • Hannes Van De Vreken
  • serebro
  • Daniel Kozak
  • Christian Amor Kvalheim

Cheers,

Hannes Magnusson, Derick Rethans, and Jeremy Mikola

1.0.0RC0

26 Oct 21:06
Compare
Choose a tag to compare
1.0.0RC0 Pre-release
Pre-release

The PHP team is happy to announce that version 1.0.0-RC0 of our new "mongodb" PHP extension is now available on PECL.

Release Highlights

In this release, we have changed a few APIs. The MongoDB\Driver\Manager methods for single writes have been removed (i.e. executeInsert(), executeDelete(), and executeUpdate()). Instead, executeBulkWrite() must be used for all write operations. Note that the PHP library provides methods for single write operations through its MongoDB\Collection class.

Additionally, we have removed WriteResult::getInfo() and the DuplicateKeyException, WriteConcernException, and WriteErrorException classes. We have also tidied up some use of the "final" keyword and updated our bundled libmongoc and libbson libraries to version 1.2.0.

A complete list of resolved issues in this release may be found at:
https://github.com/mongodb-labs/mongo-php-driver-prototype/blob/master/RELEASE-1.0

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-beta

or update with:

pecl upgrade mongodb-beta

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

1.0.0beta2

06 Oct 06:19
Compare
Choose a tag to compare
1.0.0beta2 Pre-release
Pre-release

The PHP team is happy to announce that version 1.0.0-beta2 of our new "mongodb" PHP extension is now available on PECL.

Release Highlights

As of this release, protected and private properties of objects are ignored when serializing the object to a BSON document. If non-public properties of a class must be serialized, users should consider implementing the MongoDB\BSON\Serializable or MongoDB\BSON\Persistable interface.

The Manager::getWriteConcern() and Manager::getReadPreference() methods now return WriteConcern and ReadPreference value objects instead of arrays describing the write concern or read preference, respectively. Additionally, getter methods (e.g. getTagSets()) have been added to both classes. The deprecated fsync option has been removed from WriteConcern.

This release bumps our libmongoc dependency to 1.2.0-rc0. Our libbson dependency has also been bumped to 1.2.0-rc0.

A complete list of resolved issues in these releases may be found at:
https://github.com/mongodb-labs/mongo-php-driver-prototype/blob/master/RELEASE-1.0

Documentation

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

Feedback

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

Installation

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

pecl install mongodb-beta

or update with:

pecl upgrade mongodb-beta

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

1.0.0beta1

10 Sep 20:03
Compare
Choose a tag to compare
1.0.0beta1 Pre-release
Pre-release

The PHP team is happy to announce that version 1.0.0-beta1 of our new "mongodb" PHP extension is now available on PECL.

Release Highlights

The behavior of Manager::getServers() has been changed to only return servers in known states (e.g. it returns nothing before initial discovery of a replica set). Additionally, Server::executeQuery() and Server::executeCommand() now take an optional ReadPreference argument.

This release also bumps our libmongoc dependency to 1.2.0-beta1.

A complete list of resolved issues in these releases may be found at:
https://github.com/mongodb-labs/mongo-php-driver-prototype/blob/master/RELEASE-1.0

Documentation

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

Feedback

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

Installation

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

pecl install mongodb-beta

or update with:

pecl upgrade mongodb-beta

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

1.0.0alpha2

21 Aug 21:05
Compare
Choose a tag to compare
1.0.0alpha2 Pre-release
Pre-release

The PHP team is happy to announce that version 1.0.0-alpha2 of our new "mongodb" PHP extension is now available on PECL.

This release addresses a Windows build error and is otherwise functionally identical to 1.0.0-alpha1.

Release Highlights

This release includes many fixes and improvements to our BSON and Object Document Serialization (ODS) functionality. Most importantly, BSON documents are now deserialized as stdClass instances by default. Custom classes and basic PHP arrays, for users preferring the legacy driver's behavior, may also be used. We hope to have more comprehensive documentation on this subject available on PHP.net soon, but examples of this functionality can be found in the extension's test suite in the meantime.

The namespace for all BSON functions and classes has been renamed from "BSON" to "MongoDB\BSON", which means all code within the extension now falls under a top-level "MongoDB" namespace. Additionally, we have renamed to toArray() and fromArray() functions to toPHP() and fromPHP(), respectively.

Some notable performance improvements in this release include coalescing bulk update/delete operations for less round trips and buffering small writes for more efficient network IO.

We have also bumped the minimum supported PHP version to 5.4 (from 5.3 in our earlier releases).

A complete list of resolved issues in these releases may be found at:
https://github.com/10gen-labs/mongo-php-driver-prototype/blob/master/RELEASE-1.0

Documentation

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

Feedback

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

Installation

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

pecl install mongodb-alpha

or update with:

pecl upgrade mongodb-alpha

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

Community Contributors

Once again, we'd like to extend special thanks to Remi Collet for his contribution to this release.

0.6.3 release -- for real this time

06 May 16:56
Compare
Choose a tag to compare
Pre-release

OK OK OK OK!

That awful copy&paste typo has been fixed. The driver can now be successfully built from a pecl packaged archive.

4 releases in 2 days tralalalala 👯

0.6.2

06 May 15:47
Compare
Choose a tag to compare
0.6.2 Pre-release
Pre-release

This release includes no functional changes over 0.6.1, but it corrects the PECL package stability ("alpha" instead of "devel").

Documentation

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

Additional documentation may be found on GitHub:
http://10gen-labs.github.io/mongo-php-driver-prototype/ods/

Feedback

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

Full Release Notes

https://github.com/10gen-labs/mongo-php-driver-prototype/blob/master/RELEASE-0.6.2

Installing on *nix

$ pecl install mongodb-alpha
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

Installing on Windows

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

0.6.1

06 May 15:36
Compare
Choose a tag to compare
0.6.1 Pre-release
Pre-release

This release includes no functional changes over 0.6.0, but it fixes an issue with the PECL package's build process.

Documentation

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

Additional documentation may be found on GitHub:
http://10gen-labs.github.io/mongo-php-driver-prototype/ods/

Feedback

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

Full Release Notes

https://github.com/10gen-labs/mongo-php-driver-prototype/blob/master/RELEASE-0.6.1

Installing on *nix

$ pecl install mongodb-alpha
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

Installing on Windows

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