Source for file forks.php
Documentation is available at forks.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* GitHub API Forks class for the Joomla Platform.
* @package Joomla.Platform
* Method to fork a repository.
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
* @param string $org The organization to fork the repo into. By default it is forked to the current user.
* @throws DomainException
public function create($user, $repo, $org =
'')
// Build the request path.
$path =
'/repos/' .
$user .
'/' .
$repo .
'/forks';
// Validate the response code.
if ($response->code !=
202)
// Decode the error response and throw an exception.
throw
new DomainException($error->message, $response->code);
* Method to list forks for a repository.
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
* @param integer $page Page to request
* @param integer $limit Number of results to return per page
* @throws DomainException
public function getList($user, $repo, $page =
0, $limit =
0)
// Build the request path.
$path =
'/repos/' .
$user .
'/' .
$repo .
'/forks';
$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.
throw
new DomainException($error->message, $response->code);
Documentation generated on Tue, 19 Nov 2013 15:03:29 +0100 by phpDocumentor 1.4.3