bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 953 forks source link

Mongo, new driver #746

Open AstRonin opened 8 years ago

AstRonin commented 8 years ago

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

danopz commented 8 years ago

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

bshaffer commented 8 years ago

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

AstRonin commented 8 years ago

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

AstRonin commented 8 years ago

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

iNDicat0r commented 8 years ago

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/

bshaffer commented 8 years ago

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

0ddlyoko commented 5 years ago

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 ^^