carpediem / mattermost-webhook
使用PHP发送Mattermost webhook通知
2.2.0
2018-01-17 13:35 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.2
- psr/http-message-implementation: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^6.2
README
此Mattermost驱动程序允许您发送传入webhook的消息。
这是从ThibaudDauce/mattermost-php的分支。
系统要求
您需要PHP >= 5.6.0,但推荐使用PHP的最新稳定版本。
安装
$ composer require carpediem/mattermost-webhook
构建状态
基本用法
以下代码将向Mattermost兼容的服务发送通知。
<?php require '/path/to/vendor/autoload.php'; use GuzzleHttp\Client as GuzzleClient; use Carpediem\Mattermost\Webhook\Client; use Carpediem\Mattermost\Webhook\Message; $mattermost = new Client(new GuzzleClient()); $message = new Message('This is a *test*.'); $response = $mattermost->notify('https://your_mattermost_webhook_url', $message); //$response is a Psr7\Http\Message\ResponseInterface.
文档
完整文档可以在carpediem.github.io找到。
贡献
欢迎贡献,所有贡献将得到充分认可。请参阅CONTRIBUTING以获取详细信息。
测试
Mattermost Webhook
有一个 PHPUnit 测试套件和一个使用 PHP CS Fixer 的编码风格合规性测试套件。要运行测试,请在项目文件夹中运行以下命令。
$ composer test
安全性
如果您发现任何安全相关的问题,请通过电子邮件dev@carpediem.fr联系,而不是使用问题跟踪器。
致谢
许可
MIT许可(MIT)。请参阅许可文件获取更多信息。