klaussilveira/gitter
Composer 安装命令:
composer require klaussilveira/gitter
包简介
Gitter allows you to interact in an object oriented manner with Git repositories.
README 文档
README
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
- git (http://git-scm.com) (tested with 1.7.5.4)
Authors and contributors
- Klaus Silveira (Creator, developer)
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());
klaussilveira/gitter 适用场景与选型建议
klaussilveira/gitter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33.24k 次下载、GitHub Stars 达 197, 最近一次更新时间为 2012 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「git」 「vcs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 klaussilveira/gitter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 klaussilveira/gitter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 klaussilveira/gitter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily manage git hooks in your composer config
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
Pure PHP Git implementation. Reads and writes Git repositories without shelling out to git.
GitHub Webhook Listener with plugin-based API for creating your own triggerered actions
eZ Update offers composer package(s) updates - Use this feature to update your website to the latest available release via composer
统计信息
- 总下载量: 33.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 199
- 点击次数: 36
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2012-09-11