有没有一个很好的PHP git客户端支持http? [英] Is there a good php git client with http support?
问题描述
对于我正在处理的项目,我们希望使用git作为我们经常修改的特定数据的修订跟踪器。我们使用php作为web前端,我们需要一个goo php git客户端来使用。我在互联网上遇到了一些问题,他们都倾向于有同样的限制......
For a project I am working on, we want to use git as a revision tracker for certain data we modify often. We are using php for the web frontend and we need a goo php git client to use. I have come across a handful on the internet and they all tend to have the same limitation...
不支持HTTP。我们需要能够推/拉到远程存储库。我们还需要克隆。
There is no support for HTTP. We need to be able to push/pull to remote repositories. We also need to clone.
理想情况下,我正在寻找一些不使用git命令的东西(例如:包装到exec()),但我愿意解决该课程运作良好。我看到了一个C库,它似乎在做我想做的事情,但是PHP语言的绑定是不完整的,http函数被标记为实验性的。
Ideally I am looking for something that does not use the git command (ie: wrapers to exec()) but I am willing to settle if the class works well. I have seen a C library which appears to do what I want, however the php language binding is incomplete and the http functions are labeled experimental.
有没有人有任何洞察使用git和http通过php?
Does anyone have any insight into using git and http through php?
推荐答案
https://github.com/kbjr/Git.php
Git.php是一个围绕git调用的包装类使用 proc_open
而不是 exec
来运行命令。虽然它没有推/拉方法,但它有一个用于运行自定义git命令的常规 run
方法,因此可以像这样使用它:
Git.php is a wrapper class around git calls that uses proc_open
instead of exec
to run the commands. While it does not have push/pull methods, it does have a general run
method for running custom git commands, so it could be used something like this:
$repo = Git::open('/path/to/repo');
$repo->run('push origin master');
它也有克隆方法( clone_to
和 clone_from
进行本地克隆, clone_remote
用于远程克隆)。
It also does have methods for cloning (clone_to
and clone_from
which do local cloning and clone_remote
for remote cloning).
这篇关于有没有一个很好的PHP git客户端支持http?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!