oauth2-server-php
oauth2-server-php copied to clipboard
Mongo, new driver
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
Perfect for some contribution, don't you think so? :wink: Looks like this has to be a new Storage for BC.
We should have a MongoDB
class, in addition to the Mongo
storage class, which correspond to the mongodb.so
and mongo.so
extensions respectively.
@copynpaste I think, I will have a time...
https://github.com/bshaffer/oauth2-server-php/pull/748
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 insert
to insertOne
, and update
to updateOne
and everything works as expected with an additional lightweight dependency which is mongodb/mongodb
http://mongodb.github.io/mongo-php-library/getting-started/
@iNDicat0r would you mind submitting a PR with your changes?
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 ^^