org_heigl / captainhook_sendtime
将您的git提交消息中的时间条目发送到API
2.0.1
2019-02-14 20:39 UTC
Requires
- php: ^7.2
- captainhook/captainhook: ^4.0
- org_heigl/captainhook_addtime: ^2.0
Requires (Dev)
- captainhook/plugin-composer: ^4.0
- phpunit/phpunit: ^7.5
Suggests
- org_heigl/captainhook_sendtime_backend_tine2: Send timetracking information to a Tine2.0-instance
This package is auto-updated.
Last update: 2024-08-31 07:34:24 UTC
README
这是CaptainHook的一个小插件,可以将您的提交消息中的时间条目发送到API。
这样您就可以通过提交消息跟踪您的计时。
要使用此工具,您需要在提交消息中添加如下条目
Time: 2h15m
这将发送一个包含2小时15分钟条目的时间跟踪API。
为了确保所有提交消息都有时间条目,我们建议使用CaptainHook的addTime附加组件。
安装
使用composer安装此包
composer require --dev org_heigl/captainhook_sendtime
使用方法
要将时间条目发送到您的API,您需要使用以下信息配置钩子
{
"commit-msg": {
"enabled": true,
"actions": [{
"action": "\\Org_Heigl\\CaptainHook\\Hooks\\Sendime\\SendTimeAction",
"options": {
"account" : "account",
"backendfactory" : "\\Org_Heigl\\CaptainHook\\Hooks\\SendTime\\Backend\\FileFactory",
"_comment" : "Following are parameters that are required by the Backend Factory. For Details see the Backend-Documentation",
"file" : "/tmp/logfile"
}
}]
}
}
这将把时间写入位于/tmp/logfile
的文本文件中。如果您想使用不同的后端,您需要通过composer添加适当的文件,然后根据后端文档配置该后端。
目前支持以下后端
- 文件
- Tine2.0
如果您缺少后端,请自由创建一个工厂和后端,该后端适当实现了Backend-Interface和BackendFactory-interface。