nazariy / git-reader
包含访问GIT日志辅助函数的库
dev-master
2019-08-06 16:01 UTC
Requires
- php: ~7.2
This package is auto-updated.
Last update: 2024-09-07 03:08:55 UTC
README
包含提供关于GIT仓库(如提交、分支和贡献者)信息的辅助函数的库
##使用方法
<?php use GitReader\Repository; $repository = new Repository('/path/to/repository'); // List Branches $branches = $repository->getBranches(); /* Results Array ( [0] => Array ( [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c [type] => heads [path] => refs/heads/master [name] => master ) [1] => Array ( [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c [type] => remotes [path] => refs/remotes/origin/HEAD [name] => origin/HEAD ) [2] => Array ( [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c [type] => remotes [path] => refs/remotes/origin/master [name] => origin/master ) ) */ // Show Contributors $contributors = $repository->getContributors(); /* Results Array ( [0] => Array ( [name] => Nazariy Slyusarchuk [email] => Nazariy@users.noreply.github.com [commits] => 4 ) ) */ // Show Stats $stats = $repository->getShortStatGraph(); /* Array ( [0] => Array ( [author] => Nazariy Slyusarchuk <Nazariy@users.noreply.github.com> [author_email] => Nazariy@users.noreply.github.com [author_name] => Slyusarchuk [changes] => Array ( [0] => Update README.md ) [comment] => Update README.md [date] => DateTime Object ( [date] => 2019-08-06 18:09:49.000000 [timezone_type] => 1 [timezone] => +03:00 ) [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c [stats] => 1 file changed, 3 insertions(+), 2 deletions(-) ) ) */