Shifting to that NoSQL life
Dropped the database abstraction layer, added a rudimentary MongoDB class, dopped all of the interface classes for the OAuth2 library and updated the dependencies to use @bshaffer's OAuth2 class as it has MongoDB support out of the box.
This commit is contained in:
parent
76611eb7da
commit
6414644f35
16 changed files with 67 additions and 2279 deletions
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Pickles\OAuth2;
|
||||
|
||||
use \League\OAuth2\Server\Storage\Adapter;
|
||||
use \League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
class ScopeStorage extends StorageAdapter implements ScopeInterface
|
||||
{
|
||||
public function get($scope, $grant_type = null, $client_id = null)
|
||||
{
|
||||
$sql = 'SELECT * FROM oauth_scopes WHERE id = ?;';
|
||||
$results = $this->db->fetch($sql, [$scope]);
|
||||
|
||||
if (count($results) === 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (new ScopeEntity($this->server))->hydrate([
|
||||
'id' => $result[0]['id'],
|
||||
'description' => $result[0]['description'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue