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

Liste de tous les membres

Fonctions membres publiques

 create ($user, $repo, $message, $tree, array $parents=array())
 createCommitComment ($user, $repo, $sha, $comment, $line, $filepath, $position)
 deleteCommitComment ($user, $repo, $id)
 editCommitComment ($user, $repo, $id, $comment)
 getCommit ($user, $repo, $sha, $page=0, $limit=0)
 getCommitComment ($user, $repo, $id)
 getCommitComments ($user, $repo, $sha, $page=0, $limit=0)
 getDiff ($user, $repo, $base, $head)
 getList ($user, $repo, $page=0, $limit=0)
 getListComments ($user, $repo, $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 commits.php.


Documentation des fonctions membres

JGithubCommits::create (   $user,
  $repo,
  $message,
  $tree,
array  $parents = array() 
)

Method to create a commit.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$messageThe commit message.
string$treeSHA of the tree object this commit points to.
array$parentsArray of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided. For a merge commit, an array of more than one should be provided.
Renvoie:
object
Depuis:
12.1

Définition à la ligne 37 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/commits';
$data = json_encode(
array('message' => $message, 'tree' => $tree, 'parents' => $parents)
);
// 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);
}
JGithubCommits::createCommitComment (   $user,
  $repo,
  $sha,
  $comment,
  $line,
  $filepath,
  $position 
)

Method to create a comment on a commit.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$shaThe SHA of the commit to comment on.
string$commentThe text of the comment.
integer$lineThe line number of the commit to comment on.
string$filepathA relative path to the file to comment on within the commit.
integer$positionLine index in the diff to comment on.
Renvoie:
object
Depuis:
12.1

Définition à la ligne 75 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments';
$data = json_encode(
array(
'body' => $comment,
'commit_id' => $sha,
'line' => (int) $line,
'path' => $filepath,
'position' => (int) $position
)
);
// 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);
}
JGithubCommits::deleteCommitComment (   $user,
  $repo,
  $id 
)

Method to delete a comment on a commit.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$idThe ID of the comment to edit.
Renvoie:
object
Depuis:
12.1

Définition à la ligne 115 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/comments/' . $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);
}
JGithubCommits::editCommitComment (   $user,
  $repo,
  $id,
  $comment 
)

Method to edit a comment on a commit.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$idThe ID of the comment to edit.
string$commentThe text of the comment.
Renvoie:
object
Depuis:
12.1

Définition à la ligne 146 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/comments/' . $id;
$data = json_encode(
array(
'body' => $comment
)
);
// 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);
}
JGithubCommits::getCommit (   $user,
  $repo,
  $sha,
  $page = 0,
  $limit = 0 
)

Method to get a single commit for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$shaThe SHA of the commit to retrieve.
integer$pagePage to request
integer$limitNumber of results to return per page
Renvoie:
array
Depuis:
12.1

Définition à la ligne 184 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha;
// 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);
}
JGithubCommits::getCommitComment (   $user,
  $repo,
  $id 
)

Method to get a single comment on a commit.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$idID of the comment to retrieve
Renvoie:
array
Depuis:
12.1

Définition à la ligne 214 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/comments/' . $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);
}
JGithubCommits::getCommitComments (   $user,
  $repo,
  $sha,
  $page = 0,
  $limit = 0 
)

Method to get a list of comments for a single commit for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$shaThe SHA of the commit to retrieve.
integer$pagePage to request
integer$limitNumber of results to return per page
Renvoie:
array
Depuis:
12.1

Définition à la ligne 246 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments';
// 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);
}
JGithubCommits::getDiff (   $user,
  $repo,
  $base,
  $head 
)

Method to get a diff for two commits.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$baseThe base of the diff, either a commit SHA or branch.
string$headThe head of the diff, either a commit SHA or branch.
Renvoie:
array
Depuis:
12.1

Définition à la ligne 277 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/compare/' . $base . '...' . $head;
// 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);
}
JGithubCommits::getList (   $user,
  $repo,
  $page = 0,
  $limit = 0 
)

Method to list commits for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$pagePage to request
integer$limitNumber of results to return per page
Renvoie:
array
Depuis:
12.1

Définition à la ligne 308 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/commits';
// 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);
}
JGithubCommits::getListComments (   $user,
  $repo,
  $page = 0,
  $limit = 0 
)

Method to get a list of commit comments for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$pagePage to request
integer$limitNumber of results to return per page
Renvoie:
array
Depuis:
12.1

Définition à la ligne 339 du fichier commits.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/comments';
// 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 :