Sammaye/MongoYii

Will this work with new MongoDB driver (not Mongo)

akost opened this issue · 15 comments

akost commented

I am trying to run this extension with PHP 5.6 and MongoDB driver and got the exception "We could not find the MongoDB extension ( http://php.net/manual/en/mongo.installation.php ), please install it".

But Mongo extension is deprecated now: http://php.net/manual/en/mongo.setup.php

Would MongoYii work with MongoDB driver?

akost commented

Sorry, found duplicate issue: #257

The answer is NO.

Hmm, you are the second to ask. Might think about it

Though if you are using the new driver you must be starting anew so why not use Yii2 with it's more advanced features and better handling of new PHP features?

akost commented

It is not so easy to migrate from Yii 1 to Yii2.
We still use the old one, but upgraded PHP and Mongo driver.

So you're mixing to two drivers? That's never normally a good idea

akost commented

No, I mean we use old Yii 1, but we migrated to the new servers with updated PHP version and MongoDB drivers.

The old code that used MongoYii with Mongo driver does not work now.
The part that uses Mongo not the main/critical part of our app, but to run this we'll need to downgrade server software or migrate to Yii2.

One of the problems with using two different versions of the driver is that you will have two different connections, doubling the threads on your servers and their overhead.

You don't have to downgrade though. The old driver is still there and works and will for a long time yet (years probably), just pecl install mongo

Deprecated just means no new features, doesn't even mean no security updates

akost commented

Thanks, will try to install deprecated driver.

Not sure if it is right place to write, but how about PHP 7.0?
pecl install mongo

WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb"
pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.0.2-4+deb.sury.org~trusty+1
No valid packages found
install failed

We are using Yii1 and trying to move code to PHP 7 as it has more speed and features, for now, only MongoYii does not work as deprecated driver requires PHP 5.x

Ah interesting, HP 7 won't allow it's install. Does Yii1 in general work with PHP7?

Yup, v 1.1.17 has copmatability with PHP7 http://www.yiiframework.com/news/93/yii-1-1-17-is-released/

Poop, hmm okay. This is one huge project to undertake. It would require a huge rewrite of the entire extension. Okay, better get a chance to plan at some point

This will be covered by this #265 when I get a chance

Need to redo the tests folder but pretty much there https://github.com/Sammaye/mongoyii-php7