class JGithubPackageRepositories extends JGithubPackage

GitHub API Activity class for the Joomla Platform.

Methods

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

__get( string $name)

Magic method to lazily create API objects

object
getListOwn( string $type = 'all', string $sort = 'full_name', string $direction = '')

List your repositories.

object
getListUser( string $user, string $type = 'all', string $sort = 'full_name', string $direction = '')

List user repositories.

object
getListOrg( string $org, string $type = 'all')

List organization repositories.

object
getList( integer $id)

List all repositories.

object
create( string $name, string $org = '', string $description = '', string $homepage = '', boolean $private = false, boolean $has_issues = false, boolean $has_wiki = false, boolean $has_downloads = false, integer $team_id, boolean $auto_init = false, string $gitignore_template = '')

Create a new repository for the authenticated user or an organization.

object
get( string $owner, string $repo)

Get a repository.

object
edit( string $owner, string $repo, string $name, string $description = '', string $homepage = '', boolean $private = false, boolean $has_issues = false, boolean $has_wiki = false, boolean $has_downloads = false, string $default_branch = '')

Edit a repository.

object
getListContributors( string $owner, string $repo, boolean $anon = false)

List contributors.

object
getListLanguages( string $owner, string $repo)

List languages.

object
getListTeams( string $owner, string $repo)

List Teams

object
getListTags( string $owner, string $repo)

List Tags.

object
getListBranches( string $owner, string $repo)

List Branches.

object
getBranch( string $owner, string $repo, string $branch)

Get a Branch.

object
delete( string $owner, string $repo)

Delete a Repository.

Details

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

Parameters

Registry $options GitHub options object.
JGithubHttp $client The HTTP client object.

JGithubPackage __get( string $name)

Magic method to lazily create API objects

Parameters

string $name Name of property to retrieve

Return Value

JGithubPackage GitHub API package object.

Exceptions

RuntimeException

object getListOwn( string $type = 'all', string $sort = 'full_name', string $direction = '')

List your repositories.

List repositories for the authenticated user.

Parameters

string $type Sort type. all, owner, public, private, member. Default: all.
string $sort Sort field. created, updated, pushed, fullname, default: fullname.
string $direction Sort direction. asc or desc, default: when using full_name: asc, otherwise desc.

Return Value

object

Exceptions

RuntimeException

object getListUser( string $user, string $type = 'all', string $sort = 'full_name', string $direction = '')

List user repositories.

List public repositories for the specified user.

Parameters

string $user The user name.
string $type Sort type. all, owner, member. Default: all.
string $sort Sort field. created, updated, pushed, fullname, default: fullname.
string $direction Sort direction. asc or desc, default: when using full_name: asc, otherwise desc.

Return Value

object

Exceptions

RuntimeException

object getListOrg( string $org, string $type = 'all')

List organization repositories.

List repositories for the specified org.

Parameters

string $org The name of the organization.
string $type Sort type. all, public, private, forks, sources, member. Default: all.

Return Value

object

Exceptions

RuntimeException

object getList( integer $id)

List all repositories.

This provides a dump of every repository, in the order that they were created.

Parameters

integer $id The integer ID of the last Repository that you’ve seen.

Return Value

object

Exceptions

RuntimeException

object create( string $name, string $org = '', string $description = '', string $homepage = '', boolean $private = false, boolean $has_issues = false, boolean $has_wiki = false, boolean $has_downloads = false, integer $team_id, boolean $auto_init = false, string $gitignore_template = '')

Create a new repository for the authenticated user or an organization.

OAuth users must supply repo scope.

Parameters

string $name The repository name.
string $org The organization name (if needed).
string $description The repository description.
string $homepage The repository homepage.
boolean $private Set true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account.
boolean $has_issues Set true to enable issues for this repository, false to disable them.
boolean $has_wiki Set true to enable the wiki for this repository, false to disable it.
boolean $has_downloads Set true to enable downloads for this repository, false to disable them.
integer $team_id The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.
boolean $auto_init true to create an initial commit with empty README.
string $gitignore_template Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, “Haskell” Ignored if auto_init parameter is not provided.

Return Value

object

object get( string $owner, string $repo)

Get a repository.

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object

object edit( string $owner, string $repo, string $name, string $description = '', string $homepage = '', boolean $private = false, boolean $has_issues = false, boolean $has_wiki = false, boolean $has_downloads = false, string $default_branch = '')

Edit a repository.

Parameters

string $owner Repository owner.
string $repo Repository name.
string $name The repository name.
string $description The repository description.
string $homepage The repository homepage.
boolean $private Set true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account.
boolean $has_issues Set true to enable issues for this repository, false to disable them.
boolean $has_wiki Set true to enable the wiki for this repository, false to disable it.
boolean $has_downloads Set true to enable downloads for this repository, false to disable them.
string $default_branch Update the default branch for this repository

Return Value

object

object getListContributors( string $owner, string $repo, boolean $anon = false)

List contributors.

Parameters

string $owner Repository owner.
string $repo Repository name.
boolean $anon Set to 1 or true to include anonymous contributors in results.

Return Value

object

object getListLanguages( string $owner, string $repo)

List languages.

List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language.

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object

object getListTeams( string $owner, string $repo)

List Teams

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object

object getListTags( string $owner, string $repo)

List Tags.

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object

object getListBranches( string $owner, string $repo)

List Branches.

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object

object getBranch( string $owner, string $repo, string $branch)

Get a Branch.

Parameters

string $owner Repository owner.
string $repo Repository name.
string $branch Branch name.

Return Value

object

object delete( string $owner, string $repo)

Delete a Repository.

Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required.

Parameters

string $owner Repository owner.
string $repo Repository name.

Return Value

object