coderovich/yii2-pushover
Composer 安装命令:
composer require coderovich/yii2-pushover
包简介
A Yii2 PushOver log target and pushover messaging component
关键字:
README 文档
README
Yii2 Pushover provides a component and log targets to send Pushover (https://pushover.net/) messages.
Install
composer require consynki/yii2-pushover "*"
Or add "consynki/yii2-pushover": "*" to your composer.json file and run composer update
In config file:
'components' => [ 'pushover' => [ 'class' => 'consynki\yii\pushover\Pushover', 'user_key' => '<your-user-key>', 'api_key' => '<your-api-key>', ], 'log' => [ 'targets' => [ [ 'class' => 'consynki\yii\pushover\Target', 'levels' => ['error'], 'except' => ['yii\web\HttpException:404'], ] ], ], ]
You only need to confider the log target if you wish to send messages to pushover via the logging system. If you wish you can manual send messages directly via the component.
The log trace will support any additional standard Yii2 log target params.
It is recommended to limit the number of messages that are sent via pushover to critical issues. The best option is to only send errors, in addition you can ignore particular common error types events 404
If application doesn't have pushover component, no errors will try to be logged to pushover. This is useful for development environments, for example.
Usage
Pushover Component
If you would like to send a message without using the log target you can simply use the component directly
Yii::$app->pushover->send($message, $title, $sound);
Log Target
Exceptions and PHP errors are caught without effort. Standart Yii::(error|warning|info|trace) logging works as usual, but you also can use the following format:
Yii::error('Error Message', 'Error Category')
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-25