MongoDB PHP Library 1.8.0 released

The PHP team is happy to announce that version 1.8.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release makes the library compatible with PHP 8.

With this release, errors that occur while copying GridFS stream contents will now cause an exception instead of relying on PHP to emit a warning. This primarily affects the downloadToStream, downloadToStreamByName, and uploadFromStream methods for MongoDB\GridFS\Bucket.

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

Documentation

Documentation for this library may be found at:
https://docs.mongodb.com/php-library/

Feedback

If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1

Installation

This library may be installed or upgraded with:

composer require mongodb/mongodb^1.8.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

This invocation fails on

  • Ubuntu 20.04
  • PHP 7.4.3
  • Composer version 1.10.13 2020-09-09 11:46:34
$ composer require mongodb/mongodb^1.8.0                                                                                                                                                   
  [InvalidArgumentException]                                                                                                                         
  Could not find a matching version of package mongodb/mongodb^1.8.0. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

However, editing the composer.json and calling composer update mongodb/mongodb works