sebwite/git
Composer 安装命令:
composer require sebwite/git
包简介
Github/Bitbucket api with equal interface and flysystem.
README 文档
README
The sebwite/git package provides seemless switching between github and bitbucket API calls and filesystem operations.
Created for the Laravel 5 framework.
The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.
Quick Overview
For the full documenation, check out the sebwite-git package documenatation.
Configuration
Define your connections in config/services.php.
return [
'conn1' => [
'driver' => 'bitbucket', // bitbucket | github
'auth' => Sebwite\Git\Manager::AUTH_BASIC,
'username' => 'user1',
'password' => 'passwd'
],
'conn2' => [
'driver' => 'bitbucket', // bitbucket | github
'auth' => Sebwite\Git\Manager::AUTH_OAUTH,
'key' => 'a#W23r2baaaf',
'secret' => 'we8r9w1ef32f'
],
'conn3' => [
'driver' => 'github', // bitbucket | github
'auth' => Sebwite\Git\Manager::AUTH_TOKEN,
'secret' => 'asAER4562aw32po'
]
];
Filesystem
$fs = Git::getFilesystem($repo, $owner = null, $ref = null);
$fs->exists('composer.json');
$com = $fs->get('composer.json');
// the other Flysystem methods yo are most likely familiar with..
API calls
Git::getUser();
Git::getUsername();
Git::listWebhooks($repo, $owner = null);
Git::getWebhook($repo, $uuid, $owner = null);
Git::createWebhook($repo, array $data, $owner = null);
Git::removeWebhook($repo, $uuid, $owner = null);
Git::listOrganisations($owner = null);
Git::listRepositories($owner = null);
Git::createRepository($repo, array $data = [ ], $owner = null);
Git::deleteRepository($repo, $owner = null);
Git::getBranches($repo, $owner = null);
Git::getMainBranch($repo, $owner = null);
Git::getRepositoryManifest($repo, $ref, $owner = null);
Git::getTags($repo, $owner = null);
Git::getRaw($repo, $ref, $path, $owner = null);
Git::getChangeset($repo, $ref, $path, $owner = null);
Git::getRepositoryCommits($repo, $owner = null);
Git::getBranchCommits($repo, $branch, $owner = null);
Transformers
Transformers are responsible for transforming the raw api call response data into a common, similar response.
If wanted, you can extend and use your own implementation. Also provided is a NullTransformer which won't transform anything.
Git::setTransformer(NullTransformer::class);
Git::setTransformer(BitbucketTransformer::class);
Git::setTransformer(GithubTransformer::class);
统计信息
- 总下载量: 361
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-28