JGithubPackageRepositories

Extends \JGithubPackage

GitHub API Activity class for the Joomla Platform.

deprecated
since

3.3

deprecated

4.0 Use the joomla/github package via Composer instead

documentation

https://developer.github.com/v3/repos

property-read

GitHub API object for collaborators.

GitHub API object for comments.

GitHub API object for commits.

GitHub API object for contents.

GitHub API object for downloads.

GitHub API object for forks.

GitHub API object for hooks.

GitHub API object for keys.

GitHub API object for merging.

GitHub API object for statuses.

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null) 
inherited
since

1.7.3

Arguments

$options

\Joomla\Registry\RegistryGitHub options object.

$client

\JGithubHttpThe HTTP client object.

__get

Magic method to lazily create API objects

__get(string $name) : \JGithubPackage
inherited
since

3.3

throws

\RuntimeException

Arguments

$name

stringName of property to retrieve

Response

\JGithubPackageGitHub API package object.

create

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

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 = '') : object

OAuth users must supply repo scope.

Arguments

$name

stringThe repository name.

$org

stringThe organization name (if needed).

$description

stringThe repository description.

$homepage

stringThe repository homepage.

$private

booleanSet true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account.

$has_issues

booleanSet true to enable issues for this repository, false to disable them.

$has_wiki

booleanSet true to enable the wiki for this repository, false to disable it.

$has_downloads

booleanSet true to enable downloads for this repository, false to disable them.

$team_id

integerThe id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.

$auto_init

booleantrue to create an initial commit with empty README.

$gitignore_template

stringDesired 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.

Response

object

delete

Delete a Repository.

delete(string $owner, string $repo) : object

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

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

edit

Edit a repository.

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 = '') : object

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

$name

stringThe repository name.

$description

stringThe repository description.

$homepage

stringThe repository homepage.

$private

booleanSet true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account.

$has_issues

booleanSet true to enable issues for this repository, false to disable them.

$has_wiki

booleanSet true to enable the wiki for this repository, false to disable it.

$has_downloads

booleanSet true to enable downloads for this repository, false to disable them.

$default_branch

stringUpdate the default branch for this repository

Response

object

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $page, integer $limit) : string
inherited
since

1.7.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

get

Get a repository.

get(string $owner, string $repo) : object

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

getBranch

Get a Branch.

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

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

$branch

stringBranch name.

Response

object

getList

List all repositories.

getList(integer $id) : object

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

throws

\RuntimeException

Arguments

$id

integerThe integer ID of the last Repository that you’ve seen.

Response

object

getListBranches

List Branches.

getListBranches(string $owner, string $repo) : object

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

getListContributors

List contributors.

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

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

$anon

booleanSet to 1 or true to include anonymous contributors in results.

Response

object

getListLanguages

List languages.

getListLanguages(string $owner, string $repo) : object

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.

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

getListOrg

List organization repositories.

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

List repositories for the specified org.

throws

\RuntimeException

Arguments

$org

stringThe name of the organization.

$type

stringSort type. all, public, private, forks, sources, member. Default: all.

Response

object

getListOwn

List your repositories.

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

List repositories for the authenticated user.

throws

\RuntimeException

Arguments

$type

stringSort type. all, owner, public, private, member. Default: all.

$sort

stringSort field. created, updated, pushed, full_name, default: full_name.

$direction

stringSort direction. asc or desc, default: when using full_name: asc, otherwise desc.

Response

object

getListTags

List Tags.

getListTags(string $owner, string $repo) : object

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

getListTeams

List Teams

getListTeams(string $owner, string $repo) : object

Arguments

$owner

stringRepository owner.

$repo

stringRepository name.

Response

object

getListUser

List user repositories.

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

List public repositories for the specified user.

throws

\RuntimeException

Arguments

$user

stringThe user name.

$type

stringSort type. all, owner, member. Default: all.

$sort

stringSort field. created, updated, pushed, full_name, default: full_name.

$direction

stringSort direction. asc or desc, default: when using full_name: asc, otherwise desc.

Response

object

processResponse

Process the response and decode it.

processResponse(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
inherited
throws

\DomainException

since

3.3.0

Arguments

$response

\JHttpResponseThe response.

$expectedCode

integerThe expected "good" code.

$decode

booleanIf the should be response be JSON decoded.

Response

mixed

Properties

name

inherited
since

3.3

Type(s)

string

packages

inherited
since

3.3

Type(s)

array

options

Options for the GitHub object.

inherited
since

1.7.3

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.7.3

Type(s)

\JGithubHttp

collaborators

GitHub API object for collaborators.

Type(s)

\JGithubPackageRepositoriesCollaborators

comments

GitHub API object for comments.

Type(s)

\JGithubPackageRepositoriesComments

commits

GitHub API object for commits.

Type(s)

\JGithubPackageRepositoriesCommits

contents

GitHub API object for contents.

Type(s)

\JGithubPackageRepositoriesContents

downloads

GitHub API object for downloads.

Type(s)

\JGithubPackageRepositoriesDownloads

forks

GitHub API object for forks.

Type(s)

\JGithubPackageRepositoriesForks

hooks

GitHub API object for hooks.

Type(s)

\JGithubPackageRepositoriesHooks

keys

GitHub API object for keys.

Type(s)

\JGithubPackageRepositoriesKeys

merging

GitHub API object for merging.

Type(s)

\JGithubPackageRepositoriesMerging

statuses

GitHub API object for statuses.

Type(s)

\JGithubPackageRepositoriesStatuses