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

Liste de tous les membres

Fonctions membres publiques

 create ($user, $repo, $name, array $config, array $events=array('push'), $active=true)
 delete ($user, $repo, $id)
 edit ($user, $repo, $id, $name, array $config, array $events=array('push'), array $addEvents=array(), array $removeEvents=array(), $active=true)
 get ($user, $repo, $id)
 getList ($user, $repo, $page=0, $limit=0)
 test ($user, $repo, $id)
- Fonctions membres publiques inherited from JGithubObject
 __construct (JRegistry $options=null, JGithubHttp $client=null)

Attributs protégés

 $events
- Attributs protégés inherited from JGithubObject
 $options
 $client

Additional Inherited Members

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

Description détaillée

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


Documentation des fonctions membres

JGithubHooks::create (   $user,
  $repo,
  $name,
array  $config,
array  $events = array('push'),
  $active = true 
)

Method to create a hook on a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$nameThe name of the service being called.
array$configArray containing the config for the service.
array$eventsThe events the hook will be triggered for.
boolean$activeFlag to determine if the hook is active
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException
RuntimeException

Définition à la ligne 48 du fichier hooks.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks';
// Check to ensure all events are in the allowed list
foreach ($events as $event)
{
if (!in_array($event, $this->events))
{
throw new RuntimeException('Your events array contains an unauthorized event.');
}
}
$data = json_encode(
array('name' => $name, 'config' => $config, 'events' => $events, 'active' => $active)
);
return $this->processResponse(
$this->client->post($this->fetchUrl($path), $data),
201
);
}
JGithubHooks::delete (   $user,
  $repo,
  $id 
)

Method to delete a hook

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$idID of the hook to delete.
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 84 du fichier hooks.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id;
return $this->processResponse(
$this->client->delete($this->fetchUrl($path)),
204
);
}
JGithubHooks::edit (   $user,
  $repo,
  $id,
  $name,
array  $config,
array  $events = array('push'),
array  $addEvents = array(),
array  $removeEvents = array(),
  $active = true 
)

Method to edit a hook.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$idID of the hook to edit.
string$nameThe name of the service being called.
array$configArray containing the config for the service.
array$eventsThe events the hook will be triggered for. This resets the currently set list
array$addEventsEvents to add to the hook.
array$removeEventsEvents to remove from the hook.
boolean$activeFlag to determine if the hook is active
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException
RuntimeException

Définition à la ligne 114 du fichier hooks.php.

{
// Check to ensure all events are in the allowed list
foreach ($events as $event)
{
if (!in_array($event, $this->events))
{
throw new RuntimeException('Your events array contains an unauthorized event.');
}
}
foreach ($addEvents as $event)
{
if (!in_array($event, $this->events))
{
throw new RuntimeException('Your active_events array contains an unauthorized event.');
}
}
foreach ($removeEvents as $event)
{
if (!in_array($event, $this->events))
{
throw new RuntimeException('Your remove_events array contains an unauthorized event.');
}
}
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id;
$data = json_encode(
array(
'name' => $name,
'config' => $config,
'events' => $events,
'add_events' => $addEvents,
'remove_events' => $removeEvents,
'active' => $active)
);
return $this->processResponse(
$this->client->patch($this->fetchUrl($path), $data)
);
}
JGithubHooks::get (   $user,
  $repo,
  $id 
)

Method to get details about a single hook for the repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$idID of the hook to retrieve
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 171 du fichier hooks.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id;
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
JGithubHooks::getList (   $user,
  $repo,
  $page = 0,
  $limit = 0 
)

Method to list hooks 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:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 194 du fichier hooks.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks';
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
JGithubHooks::test (   $user,
  $repo,
  $id 
)

Method to test a hook against the latest repository commit

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$idID of the hook to delete
Renvoie:
object
Depuis:
12.3
Exceptions:
DomainException

Définition à la ligne 216 du fichier hooks.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id . '/test';
return $this->processResponse(
$this->client->post($this->fetchUrl($path), json_encode('')),
204
);
}

Documentation des données membres

JGithubHooks::$events
protected
Valeur initiale :
array(
'push', 'issues', 'issue_comment', 'commit_comment', 'pull_request', 'gollum', 'watch', 'download', 'fork', 'fork_apply',
'member', 'public', 'status'
)

Définition à la ligne 27 du fichier hooks.php.


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