Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plan about support PHP MongoDB Driver? #11156

Closed
gai00 opened this issue Nov 26, 2015 · 36 comments
Closed

Any plan about support PHP MongoDB Driver? #11156

gai00 opened this issue Nov 26, 2015 · 36 comments
Labels
new feature request Planned Feature or New Feature Request

Comments

@gai00
Copy link

gai00 commented Nov 26, 2015

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.

@sergeyklay
Copy link
Contributor

In general it is necessary to conduct laborious of refactoring. You'd be able to do it? :)

@virgofx
Copy link
Contributor

virgofx commented Nov 30, 2015

+1

@gai00
Copy link
Author

gai00 commented Nov 30, 2015

I don't think I can do that...Orz

hope it can be made by someone.

@fizzka
Copy link

fizzka commented Dec 11, 2015

+1
interface has minor differences

@sergeyklay
Copy link
Contributor

@fizzka Can you please do PR?

@fizzka
Copy link

fizzka commented Dec 13, 2015

sorry, but I don't think I can do smtng good in zep =)

@Ajibola
Copy link

Ajibola commented Jan 5, 2016

+1

@memmaker
Copy link

+1

@Evgeny-
Copy link

Evgeny- commented Apr 11, 2016

+1

@ddonng
Copy link

ddonng commented Apr 19, 2016

Hope +1

@ulfims
Copy link

ulfims commented Apr 24, 2016

If i'm intersted to implement new driver, how can I do?

@ulfims
Copy link

ulfims commented Apr 24, 2016

Or someone already did this?

@sergeyklay
Copy link
Contributor

sergeyklay commented Apr 24, 2016

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

@blocklogic-au
Copy link

Im happy to look at putting in some time to this. Has anyone made a start anywhere?

@sergeyklay
Copy link
Contributor

@tigerstrikemedia It seems to me nobody

@blocklogic-au
Copy link

@sergeyklay looks like it's from scratch then ;)

@blocklogic-au
Copy link

@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.

@sergeyklay
Copy link
Contributor

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

@blocklogic-au
Copy link

@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?

@blocklogic-au
Copy link

Just added a pull request to the incubator.

phalcon/incubator#625

@blocklogic-au
Copy link

@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?

@duythien
Copy link
Contributor

@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

@blocklogic-au
Copy link

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.

@ohmcoe
Copy link

ohmcoe commented Jul 30, 2016

+1

Hope for PHP7.

@sergeyklay
Copy link
Contributor

@elias1710
Copy link

+1

@Jurigag
Copy link
Contributor

Jurigag commented Mar 9, 2017

@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.

@afbora
Copy link

afbora commented Jan 11, 2018

+1

@cmeheut
Copy link

cmeheut commented Jan 23, 2018

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

@Jurigag
Copy link
Contributor

Jurigag commented Jan 23, 2018

@cmeheut there is adapter in incubator already, not sure which exactly mongo versions it support.

@stale stale bot added the stale Stale issue - automatically closed label Apr 23, 2018
@stale stale bot closed this as completed Apr 24, 2018
@sergeyklay sergeyklay reopened this May 2, 2018
@stale stale bot removed the stale Stale issue - automatically closed label May 2, 2018
@simpleadm
Copy link

+1

@DmytroDiachuk
Copy link

+1
I believe in it ;)

@phalcon phalcon deleted a comment from stale bot Dec 22, 2018
@niden
Copy link
Member

niden commented Feb 23, 2019

Closing in favor of #13855. Will revisit if the community votes for it, or in later versions.

@niden niden closed this as completed Feb 23, 2019
@fizzka
Copy link

fizzka commented Jun 23, 2019

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?

@niden
Copy link
Member

niden commented Jun 23, 2019

@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

https://github.com/phalcon/cphalcon/projects/3

@niden niden added 4.1 new feature request Planned Feature or New Feature Request labels Dec 9, 2019
@niden niden removed this from the 4.0.0 milestone Dec 9, 2019
@Jeckerson
Copy link
Member

Implemented as separate package - https://github.com/phalcon/incubator-mongodb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request
Projects
Archived in project
Development

No branches or pull requests