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) |
| __construct (JRegistry $options=null, JGithubHttp $client=null) |
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 | $user | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
string | $ref | The name of the fully qualified reference. |
string | $sha | The SHA1 value to set this reference to. |
- Renvoie:
- object
- Depuis:
- 11.3
Définition à la ligne 33 du fichier refs.php.
{
$path = '/repos/' . $user . '/' . $repo . '/git/refs';
$data = json_encode(
array(
'ref' => $ref,
'sha' => $sha
)
);
$response = $this->client->post($this->
fetchUrl($path), $data);
if ($response->code != 201)
{
$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 | $user | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
string | $ref | The reference to update. |
string | $sha | The SHA1 value to set the reference to. |
string | $force | Whether the update should be forced. Default to false. |
- Renvoie:
- object
- Depuis:
- 11.3
Définition à la ligne 73 du fichier refs.php.
{
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
$data = new stdClass;
if ($force)
{
$data->force = true;
}
$data->sha = $sha;
$data = json_encode($data);
$response = $this->client->patch($this->
fetchUrl($path), $data);
if ($response->code != 200)
{
$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 | $user | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
string | $ref | The reference to get. |
- Renvoie:
- object
- Depuis:
- 11.3
Définition à la ligne 117 du fichier refs.php.
{
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
$response = $this->client->get($this->
fetchUrl($path));
if ($response->code != 200)
{
$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 | $user | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
string | $namespace | Optional sub-namespace to limit the returned references. |
integer | $page | Page to request |
integer | $limit | Number of results to return per page |
- Renvoie:
- array
- Depuis:
- 11.3
Définition à la ligne 149 du fichier refs.php.
{
$path = '/repos/' . $user . '/' . $repo . '/git/refs' . $namespace;
$response = $this->client->get($this->
fetchUrl($path, $page, $limit));
if ($response->code != 200)
{
$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 :