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 JGithubRefs
+ Graphe d'héritage de JGithubRefs:
+ Graphe de collaboration de JGithubRefs:

Liste de tous les membres

Fonctions membres publiques

 create ($user, $repo, $ref, $sha)
 edit ($user, $repo, $ref, $sha, $force=false)
 get ($user, $repo, $ref)
 getList ($user, $repo, $namespace= '', $page=0, $limit=0)
- 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 refs.php.


Documentation des fonctions membres

JGithubRefs::create (   $user,
  $repo,
  $ref,
  $sha 
)

Method to create an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$refThe name of the fully qualified reference.
string$shaThe SHA1 value to set this reference to.
Renvoie:
object
Depuis:
11.3

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

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs';
// Build the request data.
$data = json_encode(
array(
'ref' => $ref,
'sha' => $sha
)
);
// 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);
}
JGithubRefs::edit (   $user,
  $repo,
  $ref,
  $sha,
  $force = false 
)

Method to update a reference.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$refThe reference to update.
string$shaThe SHA1 value to set the reference to.
string$forceWhether the update should be forced. Default to false.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 73 du fichier refs.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
// Craete the data object.
$data = new stdClass;
// If a title is set add it to the data object.
if ($force)
{
$data->force = true;
}
$data->sha = $sha;
// Encode the request data.
$data = json_encode($data);
// 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);
}
JGithubRefs::get (   $user,
  $repo,
  $ref 
)

Method to get a reference.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$refThe reference to get.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 117 du fichier refs.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
// 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);
}
JGithubRefs::getList (   $user,
  $repo,
  $namespace = '',
  $page = 0,
  $limit = 0 
)

Method to list references for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$namespaceOptional sub-namespace to limit the returned references.
integer$pagePage to request
integer$limitNumber of results to return per page
Renvoie:
array
Depuis:
11.3

Définition à la ligne 149 du fichier refs.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs' . $namespace;
// Send the request.
$response = $this->client->get($this->fetchUrl($path, $page, $limit));
// 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 :