| [ Index ] |
PHP Cross Reference of moodle-2.8 |
[Source view] [Print] [Project Stats]
(no description)
| File Size: | 612 lines (17 kb) |
| Included or required: | 1 time |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
Google_Client:: (43 methods):
__construct()
getLibraryVersion()
authenticate()
setAuthConfig()
setAuthConfigFile()
prepareScopes()
setAccessToken()
setAuth()
setIo()
setCache()
createAuthUrl()
getAccessToken()
isAccessTokenExpired()
setState()
setAccessType()
setApprovalPrompt()
setLoginHint()
setApplicationName()
setClientId()
setClientSecret()
setRedirectUri()
setRequestVisibleActions()
setDeveloperKey()
refreshToken()
revokeToken()
verifyIdToken()
verifySignedJwt()
setAssertionCredentials()
setScopes()
addScope()
getScopes()
setUseBatch()
setDefer()
execute()
shouldDefer()
getAuth()
getIo()
getCache()
getClassConfig()
setClassConfig()
getBasePath()
getApplicationName()
isAppEngine()
Class: Google_Client - X-Ref
The Google API Client| __construct($config = null) X-Ref |
| Construct the Google Client. param: $config Google_Config or string for the ini file to load |
| getLibraryVersion() X-Ref |
| Get a string containing the version of the library. return: string |
| authenticate($code) X-Ref |
| Attempt to exchange a code for an valid authentication token. Helper wrapped around the OAuth 2.0 implementation. param: $code string code from accounts.google.com return: string token |
| setAuthConfig($json) X-Ref |
| Set the auth config from the JSON string provided. This structure should match the file downloaded from the "Download JSON" button on in the Google Developer Console. param: string $json the configuration json |
| setAuthConfigFile($file) X-Ref |
| Set the auth config from the JSON file in the path provided. This should match the file downloaded from the "Download JSON" button on in the Google Developer Console. param: string $file the file location of the client json |
| prepareScopes() X-Ref |
return: array |
| setAccessToken($accessToken) X-Ref |
| Set the OAuth 2.0 access token using the string that resulted from calling createAuthUrl() or Google_Client#getAccessToken(). param: string $accessToken JSON encoded string containing in the following format: |
| setAuth(Google_Auth_Abstract $auth) X-Ref |
| Set the authenticator object param: Google_Auth_Abstract $auth |
| setIo(Google_Io_Abstract $io) X-Ref |
| Set the IO object param: Google_Io_Abstract $auth |
| setCache(Google_Cache_Abstract $cache) X-Ref |
| Set the Cache object param: Google_Cache_Abstract $auth |
| 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. |
| 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: |
| setLoginHint($loginHint) X-Ref |
| Set the login hint, email address or sub id. param: string $loginHint |
| 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 |
| setClientSecret($clientSecret) X-Ref |
| Set the OAuth 2.0 Client Secret. param: string $clientSecret |
| setRedirectUri($redirectUri) X-Ref |
| Set the OAuth 2.0 Redirect URI. param: string $redirectUri |
| setRequestVisibleActions($requestVisibleActions) X-Ref |
| If 'plus.login' is included in the list of requested scopes, you can use this method to define types of app activities that your app will write. You can find a list of available types here: param: array $requestVisibleActions Array of app activity types |
| setDeveloperKey($developerKey) X-Ref |
| Set the developer key to use, these are obtained through the API Console. param: string $developerKey |
| 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_Auth_LoginTicket Returns an apiLoginTicket if the verification was |
| verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null) X-Ref |
| Verify a JWT that was signed with your own certificates. param: $jwt the token param: $certs array of certificates param: $required_audience the expected consumer of the token param: [$issuer] the expected issues, defaults to Google param: [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS return: token information if valid, false if not |
| setAssertionCredentials(Google_Auth_AssertionCredentials $creds) X-Ref |
param: Google_Auth_AssertionCredentials $creds return: void |
| setScopes($scopes) X-Ref |
| Set the scopes to be requested. Must be called before createAuthUrl(). Will remove any previously configured scopes. param: array $scopes, ie: array('https://www.googleapis.com/auth/plus.login', |
| addScope($scope_or_scopes) X-Ref |
| This functions adds a scope to be requested as part of the OAuth2.0 flow. Will append any scopes not previously requested to the scope parameter. A single string will be treated as a scope to request. An array of strings will each be appended. param: $scope_or_scopes string|array e.g. "profile" |
| getScopes() X-Ref |
| Returns the list of scopes requested by the client return: array the list of scopes |
| setUseBatch($useBatch) X-Ref |
| Declare whether batch calls should be used. This may increase throughput by making multiple requests in one connection. param: boolean $useBatch True if the batch support should |
| setDefer($defer) X-Ref |
| Declare whether making API calls should make the call immediately, or return a request which can be called with ->execute(); param: boolean $defer True if calls should not be executed right away. |
| execute($request) X-Ref |
| Helper method to execute deferred HTTP requests. returns: object of the type of the expected class or array. |
| shouldDefer() X-Ref |
| Whether or not to return raw requests return: boolean |
| getAuth() X-Ref |
return: Google_Auth_Abstract Authentication implementation |
| getIo() X-Ref |
return: Google_IO_Abstract IO implementation |
| getCache() X-Ref |
return: Google_Cache_Abstract Cache implementation |
| getClassConfig($class, $key = null) X-Ref |
| Retrieve custom configuration for a specific class. param: $class string|object - class or instance of class to retrieve param: $key string optional - key to retrieve |
| setClassConfig($class, $config, $value = null) X-Ref |
| Set configuration specific to a given class. $config->setClassConfig('Google_Cache_File', array('directory' => '/tmp/cache')); param: $class The class name for the configuration param: $config string key or an array of configuration values param: $value optional - if $config is a key, the value |
| getBasePath() X-Ref |
return: string the base URL to use for calls to the APIs |
| getApplicationName() X-Ref |
return: string the name of the application |
| isAppEngine() X-Ref |
| Are we running in Google AppEngine? return bool |
| Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |