cstretton / gitlib-fork
访问 Git 的库
dev-main
2023-03-06 11:50 UTC
Requires
- php: ^5.6 || ^7.0 || ^8.0
- ext-pcre: *
- symfony/polyfill-mbstring: ^1.7
- symfony/process: ^3.4 || ^4.4 || ^5.0 || ^6.0
Requires (Dev)
- ext-fileinfo: *
- phpspec/prophecy: ^1.10.2
- phpunit/phpunit: ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.20 || ^9.5.9
- psr/log: ^1.0
Suggests
- ext-fileinfo: Required to determine the mimetype of a blob
- psr/log: Required to use loggers for reporting of execution
Replaces
- gitonomy/gitlib: 1.3.x-dev
This package is not auto-updated.
Last update: 2024-10-01 17:40:05 UTC
README
此库提供了从 PHP 5.6+ 访问 Git 仓库的方法。
它进行 shell 调用,这使得其性能不如任何其他解决方案。
无论如何,它很方便,使用它不需要构建任何东西。这就是我们喜欢它的原因。
快速入门
您可以使用 Composer 安装 gitlib。只需要求您需要的版本
$ composer require gitonomy/gitlib
或手动编辑您的 composer.json
文件
{ "require": { "gitonomy/gitlib": "^1.3" } }
示例用法
<?php use Gitonomy\Git\Repository; $repository = new Repository('/path/to/repository'); foreach ($repository->getReferences()->getBranches() as $branch) { echo '- '.$branch->getName().PHP_EOL; } $repository->run('fetch', ['--all']);
API 文档
企业版
作为 Tidelift 订阅的一部分提供
gitonomy/gitlib
的维护者以及其他数千个包的维护者正在与 Tidelift 合作,为您使用来构建应用程序的开源依赖项提供商业支持和维护。节省时间,降低风险,并提高代码健康度,同时支付您使用的确切依赖项的维护者。了解更多信息:点击这里。