该软件包已废弃,不再维护。未建议替代软件包。

一个用于获取信息和管理远程或本地Git仓库的PHP API

v1.1.0 2015-03-04 21:58 UTC

This package is not auto-updated.

Last update: 2024-03-02 10:22:50 UTC


README

demonstration documentation 一个用于获取信息和管理GIT远程或本地仓库的PHP API。

使用方法

与本地仓库克隆一起工作

// open a repo
$local_repo = ~/repositories/git-api
$repo = \GitApi\GitApi::open($local_repo)

// commiters list
$repo->getCommitersList()

// branches list
$repo->getBranchesList()

// commits list
$repo->getCommitsList()

// current branch
$repo->getCurrentBranch()

// description
$repo->getDescription()

// tags list
$repo->getTagsList()

// last commit infos
$repo->getLastCommitInfos()

// tree
$repo->getTree()

// tree for first dir
$repo->getTree('HEAD', $first_dir)

// files info
$repo->getFilesInfo()

// recursive tree
$repo->getRecursiveTree()

// commits history
$repo->getCommitsHistory()

与远程仓库URL一起工作将创建本地克隆

// create a clone of a distant repo in a local dir
// if the local clone already exists, a `git pull` will be processed on it
$distant_repo = https://github.com/atelierspierrot/git-api
$local_repo = ~/repositories/git-api
$repo = \GitApi\GitApi::create($local_repo, $distant_repo)

// ... same as above

安装

有关如何安装此软件包及其命名空间的信息,请参阅我们的使用文档

如果您是Composer用户,只需将软件包添加到项目composer.json声明文件的要求中

"atelierspierrot/git-api": "@stable"

您可以使用特定版本或主版本的最新版本,使用适当的版本约束

请注意,此软件包依赖于外部PHP模式PHP库

作者 & 许可证

GIT API

http://github.com/atelierspierrot/git-api

版权(c)2013-2016 Pierre Cassat 和贡献者

Apache 2.0许可证下许可。

https://apache.ac.cn/licenses/LICENSE-2.0

Les Ateliers Pierrot - 法国巴黎

http://www.ateliers-pierrot.fr/ - contact@ateliers-pierrot.fr