JGithubGists

Extends \JGithubObject

GitHub API Gists class for the Joomla Platform.

package

Joomla.Platform

subpackage

GitHub

since

11.3

Methods

__construct

Constructor.

__construct(\JRegistry &$options = null, \JGithubHttp $client = null) 
inherited
since

11.3

Arguments

$options

\JRegistry

$client

\JGithubHttpThe HTTP client object.

buildFileData

Method to fetch a data array for transmitting to the GitHub API for a list of files based on an input array of file paths or filename and content pairs.

buildFileData(array $files) : array
since

11.3

Arguments

$files

arrayThe list of file paths or filenames and content.

Response

array

create

Method to create a gist.

create(mixed $files, boolean $public = false, string $description = null) : object
since

11.3

Arguments

$files

mixedEither an array of file paths or a single file path as a string.

$public

booleanTrue if the gist should be public.

$description

stringThe optional description of the gist.

Response

object

createComment

Method to create a comment on a gist.

createComment(integer $gistId, string $body) : object
since

11.3

Arguments

$gistId

integerThe gist number.

$body

stringThe comment body text.

Response

object

delete

Method to delete a gist.

delete(integer $gistId) : void
since

11.3

Arguments

$gistId

integerThe gist number.

deleteComment

Method to delete a comment on a gist.

deleteComment(integer $commentId) : void
since

11.3

Arguments

$commentId

integerThe id of the comment to delete.

edit

Method to update a gist.

edit(integer $gistId, mixed $files = null, boolean $public = null, string $description = null) : object
since

11.3

Arguments

$gistId

integerThe gist number.

$files

mixedEither an array of file paths or a single file path as a string.

$public

booleanTrue if the gist should be public.

$description

stringThe description of the gist.

Response

object

editComment

Method to update a comment on a gist.

editComment(integer $commentId, string $body) : object
since

11.3

Arguments

$commentId

integerThe id of the comment to update.

$body

stringThe new body text for the comment.

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

11.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

fork

Method to fork a gist.

fork(integer $gistId) : object
since

11.3

Arguments

$gistId

integerThe gist number.

Response

object

get

Method to get a single gist.

get(integer $gistId) : object
since

11.3

Arguments

$gistId

integerThe gist number.

Response

object

getComment

Method to get a specific comment on a gist.

getComment(integer $commentId) : object
since

11.3

Arguments

$commentId

integerThe comment id to get.

Response

object

getComments

Method to get the list of comments on a gist.

getComments(integer $gistId, integer $page, integer $limit) : array
since

11.3

Arguments

$gistId

integerThe gist number.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getList

Method to list gists. If a user is authenticated it will return the user's gists, otherwise it will return all public gists.

getList(integer $page, integer $limit) : array
since

11.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListByUser

Method to get a list of gists belonging to a given user.

getListByUser(string $user, integer $page, integer $limit) : array
since

11.3

Arguments

$user

stringThe name of the GitHub user from which to list gists.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListPublic

Method to get a list of all public gists.

getListPublic(integer $page, integer $limit) : array
since

11.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListStarred

Method to get a list of the authenticated users' starred gists.

getListStarred(integer $page, integer $limit) : array
since

11.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

isStarred

Method to check if a gist has been starred.

isStarred(integer $gistId) : boolean
since

11.3

Arguments

$gistId

integerThe gist number.

Response

booleanTrue if the gist is starred.

star

Method to star a gist.

star(integer $gistId) : void
since

11.3

Arguments

$gistId

integerThe gist number.

unstar

Method to star a gist.

unstar(integer $gistId) : void
since

11.3

Arguments

$gistId

integerThe gist number.

Properties

options

Options for the GitHub object.

inherited
since

11.3

Type(s)

\JRegistry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

11.3

Type(s)

\JGithubHttp