notify-events/php
最新稳定版本:1.1.1
Composer 安装命令:
composer require notify-events/php
包简介
PHP extension to integrate your project with Notify.Events service.
README 文档
README
A simple PHP extension that simplifies the process of integrating your project with the Notify.Events service to send messages to your channels.
Instruction on another languages
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist notify-events/php
or add
"notify-events/php": "~1.0"
to the require section of your composer.json.
Usage
To use this extension, you need to import the Message class into your PHP script.
If you used composer for installation, it will be enough to include the autoload.php file:
require_once "vendor/autoload.php";
Otherwise, if you added the extension manually, you need to import the Message class by yourself:
require_once "path/to/notify-events/php/Message.php";
After that, you can create a message object, set the necessary parameters and send the message to the channel.
Usage example
<?php require_once "vendor/autoload.php"; // Defining channel token. // You get this token when creating a channel on the Notify.Events service. $myChannelToken = 'XXXXXXXX'; // Create a message object. $message = new Message('Some <b>important</b> message', 'Title', Message::PRIORITY_HIGH, Message::LEVEL_ERROR); // Attach the file to the message. $message->addFile('path\to\local\file'); // Send a message to your channel in Notify.Events. $message->send($myChannelToken); ?>
统计信息
- 总下载量: 658
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-04