Repositories

Extends AbstractPackage

GitHub API Activity class for the Joomla Framework.

since

1.0

documentation

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

property-read Branches

GitHub API object for branches.

GitHub API object for collaborators.

GitHub API object for comments.

GitHub API object for commits.

GitHub API object for contents.

GitHub API object for deployments.

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

GitHub API object for releases.

GitHub API object for statistics.

GitHub API object for statuses.

package

Joomla Framework

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry options = null, \Joomla\Http\Http client = null) : mixed
inherited
since

1.0

Arguments

options

\Joomla\Registry\RegistryGitHub options object.

client

\Joomla\Http\HttpThe HTTP client object.

Response

mixed

__get

Magic method to lazily create API objects

__get(string name) : \Joomla\Github\AbstractPackage
inherited
since

1.0

throws

\InvalidArgumentException

Arguments

name

stringName of property to retrieve

Response

\Joomla\Github\AbstractPackageGitHub API package object.

create

Create.

create(string name, string org = '', string description = '', string homepage = '', bool private = false, bool hasIssues = false, bool hasWiki = false, bool hasDownloads = false, int teamId, bool autoInit = false, string gitignoreTemplate = '') : object

Create a new repository for the authenticated user or an organization. OAuth users must supply repo scope.

since

1.0

Arguments

name

stringThe repository name.

org

stringThe organization name (if needed).

description

stringThe repository description.

homepage

stringThe repository homepage.

private

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

hasIssues

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

hasWiki

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

hasDownloads

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

teamId

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

autoInit

booltrue to create an initial commit with empty README.

gitignoreTemplate

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.

since

1.0

Arguments

owner

stringRepository owner.

repo

stringRepository name.

Response

object

edit

Edit.

edit(string owner, string repo, string name, string description = '', string homepage = '', bool private = false, bool hasIssues = false, bool hasWiki = false, bool hasDownloads = false, string defaultBranch = '') : object
since

1.0

Arguments

owner

stringRepository owner.

repo

stringRepository name.

name

stringThe repository name.

description

stringThe repository description.

homepage

stringThe repository homepage.

private

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

hasIssues

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

hasWiki

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

hasDownloads

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

defaultBranch

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, int page, int limit) : \Joomla\Uri\Uri
inherited
since

1.0

Arguments

path

stringURL to inflect

page

intPage to request

limit

intNumber of results to return per page

Response

\Joomla\Uri\Uri

get

Get.

get(string owner, string repo) : object
since

1.0

Arguments

owner

stringRepository owner.

repo

stringRepository name.

Response

object

getList

List all public repositories.

getList(int id) : object

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

since

1.0

throws

\RuntimeException

Arguments

id

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

Response

object

getListContributors

List contributors.

getListContributors(string owner, string repo, bool anon = false) : object
since

1.0

Arguments

owner

stringRepository owner.

repo

stringRepository name.

anon

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

since

1.0

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.

since

1.0

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.

since

1.0

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
since

1.0

Arguments

owner

stringRepository owner.

repo

stringRepository name.

Response

object

getListTeams

List Teams

getListTeams(string owner, string repo) : object
since

1.0

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.

since

1.0

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(\Joomla\Http\Response response, int expectedCode = 200) : mixed
inherited
since

1.0

throws

\Joomla\Http\Exception\UnexpectedResponseException

Arguments

response

\Joomla\Http\ResponseThe response.

expectedCode

intThe expected "good" code.

Response

mixed

Properties

options

Options for the GitHub object.

inherited
since

1.0

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.0

Type(s)

\Joomla\Http\Http

package

The package the object resides in

inherited
since

1.0

Type(s)

string

hookEvents

Array containing the allowed hook events

inherited
since

1.5.2

link
note

From 1.4.0 to 1.5.1 this was named $events, it was renamed due to naming conflicts with package subclasses

Type(s)

array

branches

GitHub API object for branches.

Type(s)

\Joomla\Github\Package\Repositories\Branches

collaborators

GitHub API object for collaborators.

Type(s)

\Joomla\Github\Package\Repositories\Collaborators

comments

GitHub API object for comments.

Type(s)

\Joomla\Github\Package\Repositories\Comments

commits

GitHub API object for commits.

Type(s)

\Joomla\Github\Package\Repositories\Commits

contents

GitHub API object for contents.

Type(s)

\Joomla\Github\Package\Repositories\Contents

deployments

GitHub API object for deployments.

Type(s)

\Joomla\Github\Package\Repositories\Deployments

downloads

GitHub API object for downloads.

Type(s)

\Joomla\Github\Package\Repositories\Downloads

forks

GitHub API object for forks.

Type(s)

\Joomla\Github\Package\Repositories\Forks

hooks

GitHub API object for hooks.

Type(s)

\Joomla\Github\Package\Repositories\Hooks

keys

GitHub API object for keys.

Type(s)

\Joomla\Github\Package\Repositories\Keys

merging

GitHub API object for merging.

Type(s)

\Joomla\Github\Package\Repositories\Merging

pages

GitHub API object for pages.

Type(s)

\Joomla\Github\Package\Repositories\Pages

releases

GitHub API object for releases.

Type(s)

\Joomla\Github\Package\Repositories\Releases

statistics

GitHub API object for statistics.

Type(s)

\Joomla\Github\Package\Repositories\Statistics

statuses

GitHub API object for statuses.

Type(s)

\Joomla\Github\Package\Repositories\Statuses