mizanur/hipchat-notifier
Composer 安装命令:
composer require mizanur/hipchat-notifier
包简介
Hipchat Notifier for PHP
README 文档
README
Super-simple, minimum abstraction HipchatNotifier v2, in PHP.
Requires PHP 5.3 and a pulse.
Installation
You can install the hipchat-notifier using Composer:
composer require mizanur/hipchat-notifier
or
composer require mizanur/hipchat-notifier
HOW TO USER
You can start with .env or without .env
With .env
We need setup some configuration variable in .env
HIPCHAT_DOMAIN=https://example.hipchat.com
HIPCHAT_TOKEN=your-room-token
HIPCHAT_ROOM_ID=your-room-id
HIPCHAT_BOT_NAME=your-bot-name (this one is optional, default bot name is HIP-BOT)
Initialize hipchat notifier
$hipchatNotifier = new \HipchatNotifier\HipchatNotifier();
Without .env
Initialize hipchat notifier
//the last param bot-name is optional, default bot name is HIP-BOT
$hipchatNotifier = new \HipchatNotifier\HipchatNotifier('YOUR-DOMAIN','YOUR-ROOM-ID','YOUR-ROOM-TOKEN', 'BOT-NAME');
Send error notification to your hipchat room
//you can pass your color as second param (red or green or yellow) default is red
$hipchatNotifier->notifyError('YOUR ERROR MESSAGE');
//or
$hipchatNotifier->notifyError('YOUR ERROR MESSAGE', 'green');
Send success or info notification to your hipchat room
//you can pass your color as second param (red or green or yellow) default is green
$hipchatNotifier->notifyInfo('YOUR MESSAGE');
//or
$hipchatNotifier->notifyInfo('YOUR MESSAGE', 'red');
Send exception notification to your hipchat room
//you can pass your color as second param (red or green or yellow) default is red
try{
#Your code...
}catch(\Exception $ex){
$hipchatNotifier->notifyException($ex);
}
//or
try{
#Your code...
}catch(\Exception $ex){
$hipchatNotifier->notifyException($ex, 'yellow');
}
统计信息
- 总下载量: 556
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-10