sebwite/git 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sebwite/git

Composer 安装命令:

composer require sebwite/git

包简介

Github/Bitbucket api with equal interface and flysystem.

README 文档

README

Build Status Scrutinizer coverage Scrutinizer quality Source License

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
  • 点击次数: 3
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固