A PHP compatibility layer providing the legacy ext-mongo API on top of the modern MongoDB driver for PHP 7+.
Mongo PHP Adapter is a compatibility library that provides the deprecated `ext-mongo` extension's API using the modern `ext-mongodb` driver and `mongo-php-library`. It solves the problem of running legacy PHP applications that depend on the old MongoDB driver on PHP 7 and newer versions, allowing gradual migration without immediate code rewrites.
PHP developers maintaining applications or libraries (like Doctrine MongoDB ODM) that rely on the legacy `ext-mongo` extension and need to upgrade to PHP 7+ without breaking existing database code.
It offers a seamless bridge for legacy codebases, reducing migration effort and risk by emulating the old API while leveraging the modern, maintained MongoDB driver. Developers choose it to avoid rewriting large portions of database interaction code during PHP version upgrades.
:link: [Deprecated] Adapter to provide ext-mongo interface on top of mongo-php-library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the entire ext-mongo interface, allowing existing applications to run on PHP 7+ without major code rewrites, as highlighted in the README's goal section.
Provides a bridge from the deprecated ext-mongo to ext-mongodb, solving the core problem of running legacy MongoDB code on modern PHP versions, as stated in the description.
Built on top of the official mongo-php-library and ext-mongodb, ensuring reliability and performance benefits from the maintained, modern MongoDB ecosystem.
Specifically designed to support Doctrine MongoDB ODM during PHP upgrades, making it a targeted solution for a common legacy use case, as noted in the key features.
Several methods are missing or not fully implemented, such as MongoLog, MongoClient::connect, and MongoCursor::setFlag, as detailed in the 'Known issues' section of the README.
Serialization of MongoDB objects like MongoGridFSFile is broken, and error codes are triggered as user errors instead of system errors, which can disrupt existing error handling routines.
Installation requires a Composer workaround (setting platform.ext-mongo) due to a bug, adding complexity and potential maintenance headaches for deployment.