定制 klaussilveira/gitter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

klaussilveira/gitter

最新稳定版本:1.0

Composer 安装命令:

composer require klaussilveira/gitter

包简介

Gitter allows you to interact in an object oriented manner with Git repositories.

关键字:

README 文档

README

Latest Stable Version License Build Status

Gitter allows you to interact in an object oriented manner with Git repositories via PHP. The main goal of the library is not to replace the system git command, but provide a coherent, stable and performatic object oriented interface.

Most commands are sent to the system's git command, parsed and then interpreted by Gitter. Everything is transparent to you, so you don't have to worry about a thing.

Requirements

Authors and contributors

License

New BSD license

Usage

Gitter is very easy to use and you'll just need a few method calls to get started. For example, to create a new repository:

$client = new Gitter\Client;
$repository = $client->createRepository('/home/user/test');

Or a bare repository:

$client = new Gitter\Client;
$repository = $client->createRepository('/home/user/test', true);

Or to open an existing repository:

$client = new Gitter\Client;
$repository = $client->getRepository('/home/user/anothertest');

Both methods will return a Repository object, which has various methods that allow you to interact with that repository.

Getting a list of commits

Once you get hold of the Repository object, you can use:

$commits = $repository->getCommits();
print_r($commits);

To get a list of various commits.

Getting a single commit

Given a specific commit hash, you can find information about that commit:

$commit = $repository->getCommit('920be98a05');
print_r($commit);

Getting statistics for repository

Statistics aggregators can be added to the repository:

$repository->addStatistics(array(
    new Gitter\Statistics\Contributors,
    new Gitter\Statistics\Date,
    new Gitter\Statistics\Day,
    new Gitter\Statistics\Hour
));
print_r($repository->getStatistics());

统计信息

  • 总下载量: 32.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 200
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 198
  • Watchers: 16
  • Forks: 61
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2012-09-11