定制 bigtallbill/hooker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bigtallbill/hooker

Composer 安装命令:

composer require bigtallbill/hooker

包简介

An extendable PHP commit hook

README 文档

README

Build Status

Coverage Status

codeship

hooker

An extendable php commit hook

Installation

  1. Download binary https://github.com/bigtallbill/hooker/releases/tag/0.1.0
  2. Copy the binary release to a directory that is loaded by your PATH
  3. Make the file executable chmod a+x hooker
  4. Check installation which hooker

Usage

  1. open a terminal and cd to the target repository
  2. run hooker install

This will install a hooker.json config file and also update the commit hook files for this repo to execute hooker

Now when you try to commit something for example. hooker will execute.

hooker.json Config

The hooker.json config file contains settings for each type of hook.

{
    "preCommit": {},
    "commitMsg": {
        "firstWordImperative": true,
        "maxSummaryLength": 50,
        "maxContentLength": 72,
        "summaryIgnoreUrls": true,
        "contentIgnoreUrls": true,
        "lineAfterSummaryMustBeBlank": true,
        "scripts": {
            "after": [
                {
                    "cmd": "runtests.sh",
                    "passGitArgs": false,
                    ""
                }
            ]
        }
    }
}

"scripts"

Every hook type can have the element scripts. This allows you to execute arbitrary code that is not a native hooker check.

"scripts": {
    "after": [
        {
            "cmd": "runtests.sh"
        }
    ]
}

The "after" key defines when to run the script (currently after is the only one). After means run after hooker's own internal code for that hook.

Then we have an array of scripts to run.

Here is a sample script object:

{
    "cmd": "runtests.sh",
    "passGitArgs": false,
    "relativeToRepo": false
}

"cmd" is the command to execute

"passGitArgs" When set to true will append the git arguments onto the scripts existing arguments

"relativeToRepo" Execute this script relative to the repo. Currently this is pretty dumb, it will just prepend the repository path to the cmd.

"commitMsg"

  • firstWordImperative = Ensure that the first word in a commit message is imperative present-tense
  • maxSummaryLength = The maximum length of the summary line
  • maxContentLength = The maximum length of the message body
  • summaryIgnoreUrls = Ignore length of lines with urls in (useful if you cant help the length of urls)
  • contentIgnoreUrls = Ignore length of lines with urls in (useful if you cant help the length of urls)
  • lineAfterSummaryMustBeBlank = Ensure that the line after the summary is blank

bigtallbill/hooker 适用场景与选型建议

bigtallbill/hooker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 963 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bigtallbill/hooker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bigtallbill/hooker 我们能提供哪些服务?
定制开发 / 二次开发

基于 bigtallbill/hooker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 963
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2015-03-07