class Github_Api_Organization in Bibliography Module 7.2
Searching organizations, getting organization information and managing authenticated organization account information.
@link http://develop.github.com/p/orgs.html @author Antoine Berranger <antoine at ihqs dot net> @license MIT License
Hierarchy
- class \Github_Api implements Github_ApiInterface
- class \Github_Api_Organization
Expanded class hierarchy of Github_Api_Organization
File
- modules/
CiteProc/ Github/ Api/ Organization.php, line 11
View source
class Github_Api_Organization extends Github_Api {
const ADMIN = "admin";
const PUSH = "push";
const PULL = "pull";
static $PERMISSIONS = array(
self::ADMIN,
self::PUSH,
self::PULL,
);
/**
* Get extended information about an organization by its name
* http://develop.github.com/p/orgs.html
*
* @param string $name the organization to show
* @return array informations about the organization
*/
public function show($name) {
$response = $this
->get('organizations/' . urlencode($name));
return $response['organization'];
}
/**
* List all repositories across all the organizations that you can access
* http://develop.github.com/p/orgs.html
*
* @param string $name the user name
* @return array the repositories
*/
public function getAllRepos($name) {
$response = $this
->get('organizations/repositories');
return $response['repositories'];
}
/**
* List all public repositories of any other organization
* http://develop.github.com/p/orgs.html
*
* @param string $name the organization name
* @return array the repositories
*/
public function getPublicRepos($name) {
$response = $this
->get('organizations/' . urlencode($name) . '/public_repositories');
return $response['repositories'];
}
/**
* List all public members of that organization
* http://develop.github.com/p/orgs.html
*
* @param string $name the organization name
* @return array the members
*/
public function getPublicMembers($name) {
$response = $this
->get('organizations/' . urlencode($name) . '/public_members');
return $response['users'];
}
/**
* List all teams of that organization
* http://develop.github.com/p/orgs.html
*
* @param string $name the organization name
* @return array the teams
*/
public function getTeams($name) {
$response = $this
->get('organizations/' . urlencode($name) . '/teams');
return $response['teams'];
}
/**
* Add a team to that organization
* http://develop.github.com/p/orgs.html
*
* @param string $name the organization name
* @param string $team name of the new team
* @param string $permission its permission [PULL|PUSH|ADMIN]
* @param array $name (optionnal) its repositories names
*
* @return array the teams
*/
public function addTeam($organization, $team, $permission, array $repositories = array()) {
if (!in_array($permission, self::$PERMISSIONS)) {
throw new InvalidArgumentException("Invalid value for the permission variable");
}
$response = $this
->post('organizations/' . urlencode($organization) . '/teams', array(
'team' => $team,
'permission' => $permission,
'repo_names' => $repositories,
));
return $response['teams'];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Github_Api:: |
private | property | The client | |
Github_Api:: |
protected | function | Call any path, GET method Ex: $api->get('repos/show/my-username/my-repo') | |
Github_Api:: |
protected | function | Call any path, POST method Ex: $api->post('repos/show/my-username', array('email' => 'my-new-email@provider.org')) | |
Github_Api:: |
public | function | ||
Github_Api_Organization:: |
static | property | ||
Github_Api_Organization:: |
public | function | Add a team to that organization http://develop.github.com/p/orgs.html | |
Github_Api_Organization:: |
constant | |||
Github_Api_Organization:: |
public | function | List all repositories across all the organizations that you can access http://develop.github.com/p/orgs.html | |
Github_Api_Organization:: |
public | function | List all public members of that organization http://develop.github.com/p/orgs.html | |
Github_Api_Organization:: |
public | function | List all public repositories of any other organization http://develop.github.com/p/orgs.html | |
Github_Api_Organization:: |
public | function | List all teams of that organization http://develop.github.com/p/orgs.html | |
Github_Api_Organization:: |
constant | |||
Github_Api_Organization:: |
constant | |||
Github_Api_Organization:: |
public | function | Get extended information about an organization by its name http://develop.github.com/p/orgs.html |