澳门大阳城

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

PDOOAuth2 Class Reference

Inheritance diagram for PDOOAuth2:

List of all members.

Public Member Functions

 __construct ()
 __destruct ()
 addClient ($client_id, $client_secret, $redirect_uri)

Protected Member Functions

 checkClientCredentials ($client_id, $client_secret=NULL)
 getRedirectUri ($client_id)
 getAccessToken ($oauth_token)
 setAccessToken ($oauth_token, $client_id, $expires, $scope=NULL)
 getSupportedGrantTypes ()
 getAuthCode ($code)
 setAuthCode ($code, $client_id, $redirect_uri, $expires, $scope=NULL)

Private Member Functions

 handleException ($e)

Private Attributes

 $db

Detailed Description

OAuth2 Library PDO DB Implementation.

Definition at line 18 of file PDOOAuth2.inc.


Constructor & Destructor Documentation

__construct (  ) 

Overrides OAuth2::__construct().

Definition at line 25 of file PDOOAuth2.inc.

__destruct (  ) 

Release DB connection during destruct.

Definition at line 38 of file PDOOAuth2.inc.


Member Function Documentation

addClient ( client_id,
client_secret,
redirect_uri 
)

Little helper function to add a new client to the database.

Do NOT use this in production! This sample code stores the secret in plaintext!

Parameters:
$client_id Client identifier to be stored.
$client_secret Client secret to be stored.
$redirect_uri Redirect URI to be stored.

Definition at line 63 of file PDOOAuth2.inc.

References handleException().

checkClientCredentials ( client_id,
client_secret = NULL 
) [protected]

Implements OAuth2::checkClientCredentials().

Do NOT use this in production! This sample code stores the secret in plaintext!

Reimplemented from OAuth2.

Definition at line 82 of file PDOOAuth2.inc.

References handleException().

getAccessToken ( oauth_token  )  [protected]

Implements OAuth2::getAccessToken().

Reimplemented from OAuth2.

Definition at line 124 of file PDOOAuth2.inc.

References handleException().

getAuthCode ( code  )  [protected]

Overrides OAuth2::getAuthCode().

Reimplemented from OAuth2.

Definition at line 169 of file PDOOAuth2.inc.

References handleException().

getRedirectUri ( client_id  )  [protected]

Implements OAuth2::getRedirectUri().

Reimplemented from OAuth2.

Definition at line 103 of file PDOOAuth2.inc.

References handleException().

getSupportedGrantTypes (  )  [protected]

Overrides OAuth2::getSupportedGrantTypes().

Reimplemented from OAuth2.

Definition at line 160 of file PDOOAuth2.inc.

handleException ( e  )  [private]

Handle PDO exceptional cases.

Definition at line 45 of file PDOOAuth2.inc.

Referenced by addClient(), checkClientCredentials(), getAccessToken(), getAuthCode(), getRedirectUri(), setAccessToken(), and setAuthCode().

setAccessToken ( oauth_token,
client_id,
expires,
scope = NULL 
) [protected]

Implements OAuth2::setAccessToken().

Reimplemented from OAuth2.

Definition at line 142 of file PDOOAuth2.inc.

References handleException().

setAuthCode ( code,
client_id,
redirect_uri,
expires,
scope = NULL 
) [protected]

Overrides OAuth2::setAuthCode().

Reimplemented from OAuth2.

Definition at line 187 of file PDOOAuth2.inc.

References handleException().


Member Data Documentation

$db [private]

Definition at line 20 of file PDOOAuth2.inc.


The documentation for this class was generated from the following file:
Generated on Tue Jan 25 2011 17:54:04 for oauth2-php by  doxygen 1.7.1
【网站地图】