[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/google/ -> Google_Client.php (summary)

(no description)

File Size: 454 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/google/config.php

Defines 6 classes

Google_Client:: (30 methods):
  __construct()
  addService()
  authenticate()
  prepareService()
  setAccessToken()
  setAuthClass()
  createAuthUrl()
  getAccessToken()
  isAccessTokenExpired()
  setDeveloperKey()
  setState()
  setAccessType()
  setApprovalPrompt()
  setApplicationName()
  setClientId()
  getClientId()
  setClientSecret()
  getClientSecret()
  setRedirectUri()
  getRedirectUri()
  refreshToken()
  revokeToken()
  verifyIdToken()
  setAssertionCredentials()
  setScopes()
  setUseObjects()
  setUseBatch()
  getAuth()
  getIo()
  getCache()

Google_Exception:: (0 methods):

Google_AuthException:: (0 methods):

Google_CacheException:: (0 methods):

Google_IOException:: (0 methods):

Google_ServiceException:: (2 methods):
  __construct()
  getErrors()


Class: Google_Client  - X-Ref

The Google API Client
http://code.google.com/p/google-api-php-client/

__construct($config = array()   X-Ref


addService($service, $version = false)   X-Ref
Add a service


authenticate($code = null)   X-Ref
No description

prepareService()   X-Ref

return: array

setAccessToken($accessToken)   X-Ref
Set the OAuth 2.0 access token using the string that resulted from calling authenticate()
or Google_Client#getAccessToken().

param: string $accessToken JSON encoded string containing in the following format:

setAuthClass($authClassName)   X-Ref
Set the type of Auth class the client should use.

param: string $authClassName

createAuthUrl()   X-Ref
Construct the OAuth 2.0 authorization request URI.

return: string

getAccessToken()   X-Ref
Get the OAuth 2.0 access token.

return: string $accessToken JSON encoded string in the following format:

isAccessTokenExpired()   X-Ref
Returns if the access_token is expired.

return: bool Returns True if the access_token is expired.

setDeveloperKey($developerKey)   X-Ref
Set the developer key to use, these are obtained through the API Console.

param: string $developerKey

setState($state)   X-Ref
Set OAuth 2.0 "state" parameter to achieve per-request customization.

param: string $state

setAccessType($accessType)   X-Ref

param: string $accessType Possible values for access_type include:

setApprovalPrompt($approvalPrompt)   X-Ref

param: string $approvalPrompt Possible values for approval_prompt include:

setApplicationName($applicationName)   X-Ref
Set the application name, this is included in the User-Agent HTTP header.

param: string $applicationName

setClientId($clientId)   X-Ref
Set the OAuth 2.0 Client ID.

param: string $clientId

getClientId()   X-Ref
Get the OAuth 2.0 Client ID.


setClientSecret($clientSecret)   X-Ref
Set the OAuth 2.0 Client Secret.

param: string $clientSecret

getClientSecret()   X-Ref
Get the OAuth 2.0 Client Secret.


setRedirectUri($redirectUri)   X-Ref
Set the OAuth 2.0 Redirect URI.

param: string $redirectUri

getRedirectUri()   X-Ref
Get the OAuth 2.0 Redirect URI.


refreshToken($refreshToken)   X-Ref
Fetches a fresh OAuth 2.0 access token with the given refresh token.

param: string $refreshToken
return: void

revokeToken($token = null)   X-Ref
Revoke an OAuth2 access token or refresh token. This method will revoke the current access
token, if a token isn't provided.

param: string|null $token The token (access token or a refresh token) that should be revoked.
return: boolean Returns True if the revocation was successful, otherwise False.

verifyIdToken($token = null)   X-Ref
Verify an id_token. This method will verify the current id_token, if one
isn't provided.

param: string|null $token The token (id_token) that should be verified.
return: Google_LoginTicket Returns an apiLoginTicket if the verification was

setAssertionCredentials(Google_AssertionCredentials $creds)   X-Ref

param: Google_AssertionCredentials $creds
return: void

setScopes($scopes)   X-Ref
This function allows you to overrule the automatically generated scopes,
so that you can ask for more or less permission in the auth flow
Set this before you call authenticate() though!

param: array $scopes, ie: array('https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/moderator')

setUseObjects($useObjects)   X-Ref
Declare if objects should be returned by the api service classes.

param: boolean $useObjects True if objects should be returned by the service classes.

setUseBatch($useBatch)   X-Ref
Declare if objects should be returned by the api service classes.

param: boolean $useBatch True if the experimental batch support should

getAuth()   X-Ref

return: Google_Auth the implementation of apiAuth.

getIo()   X-Ref

return: Google_IO the implementation of apiIo.

getCache()   X-Ref

return: Google_Cache the implementation of apiCache.

Class: Google_Exception  - X-Ref

Class: Google_AuthException  - X-Ref

Class: Google_CacheException  - X-Ref

Class: Google_IOException  - X-Ref

Class: Google_ServiceException  - X-Ref

__construct($message, $code = 0, Exception $previous = null,$errors = array()   X-Ref
Override default constructor to add ability to set $errors.

param: string $message
param: int $code
param: Exception|null $previous
param: [{string, string}] errors List of errors returned in an HTTP

getErrors()   X-Ref
An example of the possible errors returned.

{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization",
}

return: [{string, string}] List of errors return in an HTTP response or [].



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1