Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JGithubAccount
+ Graphe d'héritage de JGithubAccount:
+ Graphe de collaboration de JGithubAccount:

Liste de tous les membres

Fonctions membres publiques

 createAuthorisation (array $scopes=array(), $note= '', $url= '')
 deleteAuthorisation ($id)
 editAuthorisation ($id, array $scopes=array(), array $addScopes=array(), array $removeScopes=array(), $note= '', $url= '')
 getAuthorisation ($id)
 getAuthorisations ()
 getRateLimit ()
- Fonctions membres publiques inherited from JGithubObject
 __construct (JRegistry $options=null, JGithubHttp $client=null)

Additional Inherited Members

- Fonctions membres protégées inherited from JGithubObject
 fetchUrl ($path, $page=0, $limit=0)
 processResponse (JHttpResponse $response, $expectedCode=200)
- Attributs protégés inherited from JGithubObject
 $options
 $client

Description détaillée

Définition à la ligne 19 du fichier account.php.


Documentation des fonctions membres

JGithubAccount::createAuthorisation ( array  $scopes = array(),
  $note = '',
  $url = '' 
)

Method to create an authorisation.

Paramètres:
array$scopesA list of scopes that this authorisation is in.
string$noteA note to remind you what the OAuth token is for.
string$urlA URL to remind you what app the OAuth token is for.
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 33 du fichier account.php.

{
// Build the request path.
$path = '/authorizations';
$data = json_encode(
array('scopes' => $scopes, 'note' => $note, 'note_url' => $url)
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::deleteAuthorisation (   $id)

Method to delete an authorisation

Paramètres:
integer$idID of the authorisation to delete
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 66 du fichier account.php.

{
// Build the request path.
$path = '/authorizations/' . $id;
// Send the request.
$response = $this->client->delete($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 204)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::editAuthorisation (   $id,
array  $scopes = array(),
array  $addScopes = array(),
array  $removeScopes = array(),
  $note = '',
  $url = '' 
)

Method to edit an authorisation.

Paramètres:
integer$idID of the authorisation to edit
array$scopesReplaces the authorisation scopes with these.
array$addScopesA list of scopes to add to this authorisation.
array$removeScopesA list of scopes to remove from this authorisation.
string$noteA note to remind you what the OAuth token is for.
string$urlA URL to remind you what app the OAuth token is for.
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException
RuntimeException

Définition à la ligne 101 du fichier account.php.

{
// Check if more than one scopes array contains data
$scopesCount = 0;
if (!empty($scopes))
{
$scope = 'scopes';
$scopeData = $scopes;
$scopesCount++;
}
if (!empty($addScopes))
{
$scope = 'add_scopes';
$scopeData = $addScopes;
$scopesCount++;
}
if (!empty($removeScopes))
{
$scope = 'remove_scopes';
$scopeData = $removeScopes;
$scopesCount++;
}
// Only allowed to send data for one scope parameter
if ($scopesCount >= 2)
{
throw new RuntimeException('You can only send one scope key in this request.');
}
// Build the request path.
$path = '/authorizations/' . $id;
$data = json_encode(
array(
$scope => $scopeData,
'note' => $note,
'note_url' => $url
)
);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getAuthorisation (   $id)

Method to get details about an authorised application for the authenticated user.

Paramètres:
integer$idID of the authorisation to retrieve
Renvoie:
object
Depuis:
12.3
Note:
This method will only accept Basic Authentication
Exceptions:
DomainException

Définition à la ligne 167 du fichier account.php.

{
// Build the request path.
$path = '/authorizations/' . $id;
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getAuthorisations ( )

Method to get the authorised applications for the authenticated user.

Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException
Note:
This method will only accept Basic Authentication

Définition à la ligne 195 du fichier account.php.

{
// Build the request path.
$path = '/authorizations';
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getRateLimit ( )

Method to get the rate limit for the authenticated user.

Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 222 du fichier account.php.

{
// Build the request path.
$path = '/rate_limit';
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}

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