Closed gai00 closed 5 years ago
In general it is necessary to conduct laborious of refactoring. You'd be able to do it? :)
+1
I don't think I can do that...Orz
hope it can be made by someone.
+1 interface has minor differences
@fizzka Can you please do PR?
sorry, but I don't think I can do smtng good in zep =)
+1
+1
+1
Hope +1
If i'm intersted to implement new driver, how can I do?
Or someone already did this?
I propose to do it first for Incubator. We will be able to evaluate his work and usefulness. Will be able to test and see thin places. Then we can port it to the Phalcon Core
Im happy to look at putting in some time to this. Has anyone made a start anywhere?
@tigerstrikemedia It seems to me nobody
@sergeyklay looks like it's from scratch then ;)
@sergeyklay
This is deeper than I thought.
What sort of performance gains are we talking to essentially build a trimmed down version of the mongo PHP library eventually ported into zephir?
Short of requiring that library which seems quite out of line with the phalcon system, that is what would be required to support the new MongoDB extension in the ODM system of phalcon.
perhaps It would even be better at that stage to start on a full DB Adapter for MongoDB, it would seem that the majority of that sort of functionality is what mongo decided to strip out of the PHP extension.
This is deeper than I thought.
Yeah, indeed. But as @fizzka said
interface has minor differences
;)
It seems to me, we have to use current stable Mongodb API. This is really important. Of course, it's actually more complicated than it seems at first glance. But due to the fact that Phalcon is PHP extension it make sense. And yes, implementation of this feature implies compliance current Phalcon API and BC
@sergeyklay
Interface has minor differences, but pulling that interface into phalcon requires recreating the wheel as that is what mongo split out to a PHP library rather than keeping it in the extension. Seems a bit like fighting the tide to me, but I think that Phalcon has been a bit like that the whole way along.
Ill pull what will essentially be a copy of the Mongo PHP library into a MongoDB Adapter in the incubator tonight / tomorrow and try to get a model adapter running from that.
Does that make sense?
Just added a pull request to the incubator.
@sergeyklay
The travis builds are failing from code styling issues do you know of anywhere I can get a PHPStorm code style config for this?
@tigerstrikemedia Because Phalcon incubator use PSR2 styles, so you can use this library to fix your styles code
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
php phpcbf.phar --standard=PSR2 Library/Phalcon/Db/Adapter/MongoDB
We now have a very early version of the adapter (Phalcon\DB\Adapter\MongoDB) and collection (Phalcon\Mvc\MongoCollection) in the 2.1 branch of the incubator anyone who wants to test and let me know what breaks i'd be happy to work through any issues.
+1
Hope for PHP7.
+1
@belgrid it's already implemented in incubator. The code in core is for php 5, we can't make same class supporiting both php 5 and php 7 without some bad code. It's easier to have seperated class.
+1
for Mongo <= 3.5 we can use an adapter (I use https://github.com/alcaeus/mongo-php-adapter) But it's not working anymore for 3.6: The 'cursor' option is required, except for aggregate with the explain argument It seems that using the new PHP lib would be the best way
@cmeheut there is adapter in incubator already, not sure which exactly mongo versions it support.
+1
+1 I believe in it ;)
Closing in favor of #13855. Will revisit if the community votes for it, or in later versions.
hi guys what about https://github.com/alcaeus/mongo-php-adapter ? it looks easy to say "install this, while we reinventing new solution for new driver"? any thoughts?
@fizzka There is already work underway by one of the members of the community to port the latest Mongo driver to the Collection
class. That is one of the last issues we have in our v4 project
Implemented as separate package - https://github.com/phalcon/incubator-mongodb
PHP PECL "mongo" is deprecated. Ref: http://php.net/manual/en/book.mongo.php
The newer extension is PECL "mongodb" Ref: http://php.net/manual/en/set.mongodb.php
Interfaces has huge differences.