yansongda/git-notify
Composer 安装命令:
composer require yansongda/git-notify
包简介
notify the git push.
README 文档
README
git 代码推送通知
在公司进行开发时,如何优雅而又不尴尬的让老板知道自己每天几点下班,好让老板加工资,这是一个问题。
现在应该基本每个公司用钉钉,而钉钉又有机器人可以自动推送,😆,git 可以使用 webhook,于是,就有了这样一个系统。
当然,根据 git 的 webhook 特性,大家可以打开脑洞,随意实现有意思的功能。
特性
- 隐藏不需要关心的内部流程
- 可以随意增加现有类库中没有的服务
支持的服务
git 提供商
- gitee (码云)
destinations
- dingtalk (钉钉)
实现消息推送功能
安装
composer require yansongda/git-notify
使用方法
git webhook
http://your-domain/?from=gitee&to=dingtalk
服务端
<?php require './vendor/autoload.php'; $notify = new Yansongda\GitNotify\GitNotify(); // 可选。gitee 可以设置 webhook 密码,防止 URL 被恶意请求 // $notify->from->password = '123456'; // 可选。可以随意设置发送模板与格式。这里用到闭包。 // $from 为 git 服务。 /* $notify->destination->setTemplate(function ($from) { $data['msgtype'] = 'hahaha'; $data['text']['content'] = "姓名:" . $from->user_name . "\n\before:" . $from->before . "\n\nafter:" . $from->after . "\n\n推送时间:" . date('Y-m-d H:i:s'); return $data; });*/ $notify->destination->gateway = 'https://oapi.dingtalk.com/robot/send?access_token=36c01ca8552fa8f9f6xxxxx'; $response = $notify->destination->apply(); $result = $response->getBody()->getContents();
LICENSE
MIT
yansongda/git-notify 适用场景与选型建议
yansongda/git-notify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 10, 最近一次更新时间为 2017 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「git」 「notify」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yansongda/git-notify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yansongda/git-notify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yansongda/git-notify 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily manage git hooks in your composer config
Laravel 5 Flash Notifications with icons and animations and with a timeout
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Laravel package send notify using firebase
Nagios plugin to verify a git repository.
The event package provides functionality for notifying a list of observers about an event.
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-12