Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Client

Fonctions membres publiques

 __construct ($options=[], Http $http=null, Input $input=null, WebApplicationInterface $application=null)
 
 authenticate ()
 
 isAuthenticated ()
 
 createUrl ()
 
 query ($url, $data=null, $headers=[], $method='get', $timeout=null)
 
 getOption ($key, $default=null)
 
 setOption ($key, $value)
 
 getToken ()
 
 setToken ($value)
 
 refreshToken ($token=null)
 

Attributs protégés

 $options
 
 $http
 
 $input
 
 $application
 

Description détaillée

Joomla Framework class for interacting with an OAuth 2.0 server.

Depuis
1.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = [],
Http  $http = null,
Input  $input = null,
WebApplicationInterface  $application = null 
)

Constructor.

Paramètres
array | \ArrayAccess$optionsOAuth2 Client options object
Http$httpThe HTTP client object
Input$inputThe input object
WebApplicationInterface$applicationThe application object
Depuis
1.0

Références Client\$application, Client\$http, Client\$input, Client\$options, et HttpFactory\getHttp().

Documentation des fonctions membres

◆ authenticate()

authenticate ( )

Get the access token or redirect to the authentication URL.

Renvoie
array|boolean The access token or false on failure
Depuis
1.0
Exceptions
UnexpectedResponseException

Références $data, class, Client\createUrl(), Client\getOption(), et Client\setToken().

◆ createUrl()

createUrl ( )

Create the URL for authentication.

Renvoie
string
Depuis
1.0
Exceptions

Références $key, $scope, $state, $url, $value, et Client\getOption().

Référencé par Client\authenticate().

◆ getOption()

getOption (   $key,
  $default = null 
)

Get an option from the OAuth2 Client instance.

Paramètres
string$keyThe name of the option to get
mixed$defaultOptional default value, returned if the requested option does not exist.
Renvoie
mixed The option value
Depuis
1.0

Références $default, et $key.

Référencé par Client\authenticate(), Client\createUrl(), Client\getToken(), Client\query(), et Client\refreshToken().

◆ getToken()

getToken ( )

Get the access token from the Client instance.

Renvoie
array The access token
Depuis
1.0

Références Client\getOption().

Référencé par Client\isAuthenticated(), Client\query(), et Client\refreshToken().

◆ isAuthenticated()

isAuthenticated ( )

Verify if the client has been authenticated

Renvoie
boolean Is authenticated
Depuis
1.0

Références Client\getToken().

◆ query()

query (   $url,
  $data = null,
  $headers = [],
  $method = 'get',
  $timeout = null 
)

Send a signed OAuth request.

Paramètres
string$urlThe URL for the request
mixed$dataEither an associative array or a string to be sent with the request
array$headersThe headers to send with the request
string$methodThe method with which to send the request
integer$timeoutThe timeout for the request
Renvoie
Depuis
1.0
Exceptions

Références $data, $method, $url, elseif, Client\getOption(), Client\getToken(), et Client\refreshToken().

◆ refreshToken()

refreshToken (   $token = null)

Refresh the access token instance.

Paramètres
string$tokenThe refresh token
Renvoie
array The new access token
Depuis
1.0
Exceptions
UnexpectedResponseException

Références $data, Client\getOption(), Client\getToken(), et Client\setToken().

Référencé par Client\query().

◆ setOption()

setOption (   $key,
  $value 
)

Set an option for the OAuth2 Client instance.

Paramètres
string$keyThe name of the option to set
mixed$valueThe option value to set
Renvoie
Client This object for method chaining
Depuis
1.0

Références $key, $this, et $value.

Référencé par Client\setToken().

◆ setToken()

setToken (   $value)

Set an option for the Client instance.

Paramètres
array$valueThe access token
Renvoie
Client This object for method chaining
Depuis
1.0

Références $this, $value, et Client\setOption().

Référencé par Client\authenticate(), et Client\refreshToken().

Documentation des champs

◆ $application

$application
protected

Référencé par Client\__construct().

◆ $http

$http
protected

Référencé par Client\__construct().

◆ $input

$input
protected

Référencé par Client\__construct().

◆ $options

$options
protected

Référencé par Client\__construct().


La documentation de cette classe a été générée à partir du fichier suivant :