sokil/php-mongo

Support Phongo (pecl/mongodb)

sraka1 opened this issue · 8 comments

As mentioned here and here, starting with PHP7, due to be released on November 12th the old pecl/mongo extension will not be supported. It's replacement will likely be the pecl/mongodb driver, codenamed Phongo.

Seeing as PHP7 is dramatically faster than PHP5(.6), I think supporting the new driver as soon as possible would be a good idea. Not sure if it's better to create two versions/branches or to abstract all the driver API calls somewhere. In any case, the "php-mongo" API shouldn't need to change.

If I have any spare time, I might start with implementation myself.

Also, the API docs are already on PHP.net.

sokil commented

i'm already thinking about that. will be glad for any help

PHP 7.0.0 has been released; I think this should now be prioritised.

I thought about writing a backwards-compatible layer for the new driver, but don't have much time nowadays. For the moment, I might just use https://github.com/mongofill/mongofill although performance will definitely suffer.

@sokil Thoughts?

sokil commented

Old pecl driver now legacy, so i see only one right way - replace it with phongo, because this extensions too differ to try use them both. Legacy extension works with collection and database objects, new extension is low level and want to implement database and collection objects in php side. Support of legacy extension will be moved to compatibility layer of PHPMongo.

@sokil Any new updates/plans for this? Can help if help is needed.

sokil commented

No updates and currently no plans. Sorry. Best way will be to build v.2 which support only php7 and new ext and try to preserve API. If you can and want to help i can start new preject, with empty classes, compartible with v.1, and to divide implementation.

sokil commented

Currently support of PHP 7 implemented in branch https://github.com/sokil/php-mongo/tree/php7-compat-layer. Solution based on https://github.com/alcaeus/mongo-php-adapter. After few tests and improvements it will be released. I will be happy for your performance reports and bugs.