JGithubGists
Extends \JGithubObjectGitHub 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)
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
array
The 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
mixed
Either an array of file paths or a single file path as a string.- $public
boolean
True if the gist should be public.- $description
string
The 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
integer
The gist number.- $body
string
The comment body text.
Response
object
delete
Method to delete a gist.
delete(integer $gistId) : void
since |
11.3 |
---|
Arguments
- $gistId
integer
The gist number.
deleteComment
Method to delete a comment on a gist.
deleteComment(integer $commentId) : void
since |
11.3 |
---|
Arguments
- $commentId
integer
The 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
integer
The gist number.- $files
mixed
Either an array of file paths or a single file path as a string.- $public
boolean
True if the gist should be public.- $description
string
The 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
integer
The id of the comment to update.- $body
string
The 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
since |
11.3 |
---|
Arguments
- $path
string
URL to inflect- $page
integer
Page to request- $limit
integer
Number of results to return per page
Response
string
The request URL.
fork
Method to fork a gist.
fork(integer $gistId) : object
since |
11.3 |
---|
Arguments
- $gistId
integer
The gist number.
Response
object
get
Method to get a single gist.
get(integer $gistId) : object
since |
11.3 |
---|
Arguments
- $gistId
integer
The gist number.
Response
object
getComment
Method to get a specific comment on a gist.
getComment(integer $commentId) : object
since |
11.3 |
---|
Arguments
- $commentId
integer
The 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
integer
The gist number.- $page
integer
The page number from which to get items.- $limit
integer
The 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
integer
The page number from which to get items.- $limit
integer
The 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
string
The name of the GitHub user from which to list gists.- $page
integer
The page number from which to get items.- $limit
integer
The 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
integer
The page number from which to get items.- $limit
integer
The 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
integer
The page number from which to get items.- $limit
integer
The 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
integer
The gist number.
Response
boolean
True if the gist is starred.
star
Method to star a gist.
star(integer $gistId) : void
since |
11.3 |
---|
Arguments
- $gistId
integer
The gist number.
unstar
Method to star a gist.
unstar(integer $gistId) : void
since |
11.3 |
---|
Arguments
- $gistId
integer
The gist number.
Properties
client
The HTTP client object to use in sending HTTP requests.