mizanur/slack-notifier
Composer 安装命令:
composer require mizanur/slack-notifier
包简介
Slack Notifier for PHP
关键字:
README 文档
README
Super-simple, minimum abstraction SlackNotifier v1, in PHP.
Requires PHP 5.3 and a pulse.
Installation
You can install the slack-notifier using Composer:
composer require mizanur/slack-notifier
or
php composer.phar require mizanur/slack-notifier
HOW TO USER
You can start with .env or without .env
With .env
We need setup some configuration variable in .env
SLACK-WEBHOOK=https://hooks.slack.com/services/---/---/---
Initialize slack notifier
$slackNotifier = new \SlackNotifier\SlackNotifier();
Without .env
Initialize slack notifier
$slackNotifier = new \SlackNotifier\SlackNotifier('SLACK-WEBHOOK');
Send error notification to your slack channel
$slackNotifier->notifyError('YOUR ERROR MESSAGE');
Send success or info notification to your slack channel
$slackNotifier->notifyInfo('YOUR MESSAGE');
Send exception notification to your slack channel
try{
#Your code...
}catch(\Exception $ex){
$slackNotifier->notifyException($ex);
}
统计信息
- 总下载量: 1.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-11