Gists
扩展 AbstractPackageJoomla 框架的 GitHub API Gists 类。
链接 | |
---|---|
自 |
1.0 |
只读属性 Comments |
GitHub API 对象用于 gist 评论。 |
包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct(\Joomla\Registry\Registry options = null, \Joomla\Http\Http client = null) :
__get
魔术方法用于延迟创建 API 对象
__get( name) : \Joomla\Github\AbstractPackage
buildFileData
方法用于为基于文件路径输入数组或文件名和内容对的文件列表获取用于传输到 GitHub API 的数据数组。
buildFileData(mixed||string|int files) : mixed||string|int
自 |
1.0 |
---|---|
抛出 |
|
参数
- files
array<string|int, mixed>
文件路径列表或文件名和内容。
响应
array<string|int, mixed>
create
创建一个 gist。
create( files, public = false, description = null) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- files
mixed
文件路径数组或作为字符串的单个文件路径。- public
bool
如果 gist 应该是公开的,则为真。- description
string
gist 的可选描述。
响应
对象
delete
删除一个 gist。
delete( gistId) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。
响应
void
edit
编辑一个 gist。
edit( gistId, files = null, public = null, description = null) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。- files
mixed
文件路径数组或作为字符串的单个文件路径。- public
bool
如果 gist 应该是公开的,则为真。- description
string
gist 的描述。
响应
对象
fetchUrl
方法用于构建并返回请求的完整请求 URL。此方法将根据需要添加适当的分页详细信息,并将 API URL 作为前缀以获得请求的完整 URL。
fetchUrl( path, page, limit) : \Joomla\Uri\Uri
fork
分叉一个 gist。
fork( gistId) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。
响应
对象
get
获取单个 gist。
get( gistId) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。
响应
对象
getCommitList
列出 gist 提交。
getCommitList( gistId, page, limit) : mixed||string|int
自 |
1.4.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。- page
int
要获取项目的页码。- limit
int
每页的项目数。
响应
array<string|int, mixed>
getForkList
列出 gist 分叉。
getForkList( gistId, page, limit) : mixed||string|int
自 |
1.4.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。- page
int
要获取项目的页码。- limit
int
每页的项目数。
响应
array<string|int, mixed>
getList
列出 gist。
getList( page, limit) : mixed||string|int
如果用户已通过身份验证,它将返回用户的 gist,否则它将返回所有公共 gist。
自 |
1.0 |
---|---|
抛出 |
|
参数
- page
int
要获取项目的页码。- limit
int
每页的项目数。
响应
array<string|int, mixed>
getListByUser
列出用户的 gist。
getListByUser( user, page, limit, \DateTime since = null) : mixed||string|int
自 |
1.0 |
---|---|
抛出 |
|
参数
- user
string
要列出 gist 的 GitHub 用户名。- page
int
要获取项目的页码。- limit
int
每页的项目数。- 自
DateTime|null
仅返回在此时间或之后更新的 gist。
响应
array<string|int, mixed>
getListPublic
列出所有公共 gist。
getListPublic( page, limit, \DateTime since = null) : mixed||string|int
自 |
1.0 |
---|---|
抛出 |
|
参数
- page
int
要获取项目的页码。- limit
int
每页的项目数。- 自
DateTime|null
仅返回在此时间或之后更新的 gist。
响应
array<string|int, mixed>
getListStarred
列出加星标的 gist。
getListStarred( page, limit, \DateTime since = null) : mixed||string|int
自 |
1.0 |
---|---|
抛出 |
|
参数
- page
int
要获取项目的页码。- limit
int
每页的项目数。- 自
DateTime|null
仅返回在此时间或之后更新的 gist。
响应
array<string|int, mixed>
getRevision
获取 gist 的特定修订版。
getRevision( gistId, sha) :
自 |
1.4.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。- sha
string
要获取的修订版的 SHA。
响应
对象
isStarred
检查 gist 是否加星标。
isStarred( gistId) :
processResponse
处理响应并对其进行解码。
processResponse(\Joomla\Http\Response response, expectedCode = 200) :
star
将 gist 加星标。
star( gistId) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。
响应
void
unstar
取消 gist 的星标。
unstar( gistId) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- gistId
int
gist 编号。
响应
void
属性
comments
包
对象所在的包
自 |
1.0 |
---|
类型
string
hookEvents
包含允许的挂钩事件的数组
自 |
1.5.2 |
---|---|
链接 | |
note |
从 1.4.0 到 1.5.1,它被称为 $events,它被重命名为因为与包子类的命名冲突 |
类型
array<string|int, mixed>