Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Google_Config Class Reference

Public Member Functions

 __construct ($ini_file_location=null)
 Create a new Google_Config.
 
 getApplicationName ()
 
 getAuthClass ()
 Return the configured Auth class.
 
 getBasePath ()
 
 getCacheClass ()
 Return the configured cache class.
 
 getClassConfig ($class, $key=null)
 
 getIoClass ()
 Return the configured IO class.
 
 getLoggerClass ()
 Return the configured logger class.
 
 setAccessType ($access)
 Set the the access type requested (offline or online.)
 
 setApplicationName ($name)
 Set the application name, this is included in the User-Agent HTTP header.
 
 setApprovalPrompt ($approval)
 Set when to show the approval prompt (auto or force)
 
 setAuthClass ($class)
 Set the auth class.
 
 setCacheClass ($class)
 Set the cache class.
 
 setClassConfig ($class, $config, $value=null)
 Set configuration specific to a given class.
 
 setClientId ($clientId)
 Set the client ID for the auth class.
 
 setClientSecret ($secret)
 Set the client secret for the auth class.
 
 setDeveloperKey ($key)
 Set the developer key for the auth class.
 
 setHostedDomain ($hd)
 Set the hd (hosted domain) parameter streamlines the login process for Google Apps hosted accounts.
 
 setIncludeGrantedScopes ($include)
 If this is provided with the value true, and the authorization request is granted, the authorization will include any previous authorizations granted to this user/application combination for other scopes.
 
 setIoClass ($class)
 Set the IO class.
 
 setLoggerClass ($class)
 Set the logger class.
 
 setLoginHint ($hint)
 Set the login hint (email address or sub identifier)
 
 setOpenidRealm ($realm)
 openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth 2.0.
 
 setPrompt ($prompt)
 Set the prompt hint.
 
 setRedirectUri ($uri)
 Set the redirect uri for the auth class.
 
 setRequestVisibleActions ($rva)
 Set the app activities for the auth class.
 

Public Attributes

const GZIP_DISABLED = true
 
const GZIP_ENABLED = false
 
const GZIP_UPLOADS_DISABLED = false
 
const GZIP_UPLOADS_ENABLED = true
 
const TASK_RETRY_ALWAYS = -1
 
const TASK_RETRY_NEVER = 0
 
const TASK_RETRY_ONCE = 1
 
const USE_AUTO_IO_SELECTION = "auto"
 

Protected Attributes

 $configuration
 

Constructor & Destructor Documentation

◆ __construct()

Google_Config::__construct ( $ini_file_location = null)

Create a new Google_Config.

Can accept an ini file location with the local configuration. For example: application_name="My App"

Parameters
[$ini_file_location]- optional - The location of the ini file to load

Member Function Documentation

◆ getApplicationName()

Google_Config::getApplicationName ( )
Return values
stringthe name of the application

◆ getAuthClass()

Google_Config::getAuthClass ( )

Return the configured Auth class.

Return values
string

◆ getBasePath()

Google_Config::getBasePath ( )
Return values
stringthe base URL to use for API calls

◆ getCacheClass()

Google_Config::getCacheClass ( )

Return the configured cache class.

Return values
string

◆ getIoClass()

Google_Config::getIoClass ( )

Return the configured IO class.

Return values
string

◆ getLoggerClass()

Google_Config::getLoggerClass ( )

Return the configured logger class.

Return values
string

◆ setAccessType()

Google_Config::setAccessType ( $access)

Set the the access type requested (offline or online.)

Parameters
$accessstring - the access type

◆ setApplicationName()

Google_Config::setApplicationName ( $name)

Set the application name, this is included in the User-Agent HTTP header.

Parameters
string$name

◆ setApprovalPrompt()

Google_Config::setApprovalPrompt ( $approval)

Set when to show the approval prompt (auto or force)

Parameters
$approvalstring - the approval request

◆ setAuthClass()

Google_Config::setAuthClass ( $class)

Set the auth class.

Parameters
$classstring the class name to set

◆ setCacheClass()

Google_Config::setCacheClass ( $class)

Set the cache class.

Parameters
$classstring the class name to set

◆ setClassConfig()

Google_Config::setClassConfig ( $class,
$config,
$value = null )

Set configuration specific to a given class.

$config->setClassConfig('Google_Cache_File', array('directory' => '/tmp/cache'));

Parameters
$classstring The class name for the configuration
$configstring key or an array of configuration values
$valuestring optional - if $config is a key, the value

◆ setClientId()

Google_Config::setClientId ( $clientId)

Set the client ID for the auth class.

Parameters
$clientIdstring - the API console client ID

◆ setClientSecret()

Google_Config::setClientSecret ( $secret)

Set the client secret for the auth class.

Parameters
$secretstring - the API console client secret

◆ setDeveloperKey()

Google_Config::setDeveloperKey ( $key)

Set the developer key for the auth class.

Note that this is separate value from the client ID - if it looks like a URL, its a client ID!

Parameters
$keystring - the API console developer key

◆ setHostedDomain()

Google_Config::setHostedDomain ( $hd)

Set the hd (hosted domain) parameter streamlines the login process for Google Apps hosted accounts.

By including the domain of the user, you restrict sign-in to accounts at that domain.

This should not be used to ensure security on your application - check the hd values within an id token (

See also
Google_Auth_LoginTicket) after sign in to ensure that the user is from the domain you were expecting.
Parameters
$hdstring - the domain to use.

◆ setIncludeGrantedScopes()

Google_Config::setIncludeGrantedScopes ( $include)

If this is provided with the value true, and the authorization request is granted, the authorization will include any previous authorizations granted to this user/application combination for other scopes.

Parameters
$includeboolean - the URL-space to use.

◆ setIoClass()

Google_Config::setIoClass ( $class)

Set the IO class.

Parameters
$classstring the class name to set

◆ setLoggerClass()

Google_Config::setLoggerClass ( $class)

Set the logger class.

Parameters
$classstring the class name to set

◆ setLoginHint()

Google_Config::setLoginHint ( $hint)

Set the login hint (email address or sub identifier)

Parameters
$hintstring

◆ setOpenidRealm()

Google_Config::setOpenidRealm ( $realm)

openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth 2.0.

It is used in OpenID 2.0 requests to signify the URL-space for which an authentication request is valid.

Parameters
$realmstring - the URL-space to use.

◆ setPrompt()

Google_Config::setPrompt ( $prompt)

Set the prompt hint.

Valid values are none, consent and select_account. If no value is specified and the user has not previously authorized access, then the user is shown a consent screen.

Parameters
$promptstring

◆ setRedirectUri()

Google_Config::setRedirectUri ( $uri)

Set the redirect uri for the auth class.

Note that if using the Javascript based sign in flow, this should be the string 'postmessage'.

Parameters
$uristring - the URI that users should be redirected to

◆ setRequestVisibleActions()

Google_Config::setRequestVisibleActions ( $rva)

Set the app activities for the auth class.

Parameters
$rvastring a space separated list of app activity types

The documentation for this class was generated from the following file: