oauth2-server-php icon indicating copy to clipboard operation
oauth2-server-php copied to clipboard

Mongo, new driver

Open AstRonin opened this issue 8 years ago • 7 comments

Hi,

Do you have a plan of to change OAuth2\Storage\Mongo to new driver? This is need for migrate php code to new version PHP7.

Thanks

AstRonin avatar Jul 11 '16 11:07 AstRonin

Perfect for some contribution, don't you think so? :wink: Looks like this has to be a new Storage for BC.

danopz avatar Jul 11 '16 12:07 danopz

We should have a MongoDB class, in addition to the Mongo storage class, which correspond to the mongodb.so and mongo.so extensions respectively.

bshaffer avatar Jul 12 '16 17:07 bshaffer

@copynpaste I think, I will have a time...

AstRonin avatar Jul 14 '16 15:07 AstRonin

https://github.com/bshaffer/oauth2-server-php/pull/748

AstRonin avatar Jul 15 '16 11:07 AstRonin

Well I installed the new extension mongodb.so and:

composer require "mongodb/mongodb=^1.0.0"

and then just extend the Storage class called Mongo, changed the insertto insertOne, and updateto updateOneand everything works as expected with an additional lightweight dependency which is mongodb/mongodb

http://mongodb.github.io/mongo-php-library/getting-started/

iNDicat0r avatar Jul 25 '16 08:07 iNDicat0r

@iNDicat0r would you mind submitting a PR with your changes?

bshaffer avatar Jul 25 '16 21:07 bshaffer

Well, 3 years later, I made the support for the new MongoDB Driver for my project: https://github.com/FroxyNetwork/REST/blob/feature/servers/Api/Controller/DatasourceController/NewMongo.php You can use it if you want ^^

0ddlyoko avatar Jul 30 '19 01:07 0ddlyoko