brunty / pushover
此包已被废弃,不再维护。未建议替代包。
通过Pushover发送消息的客户端
dev-master
2017-09-12 21:51 UTC
Requires
- php: >=7.1
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.3
- php-http/httplug: ^1.1
- php-http/message-factory: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- guzzlehttp/psr7: ^1.4
- kahlan/kahlan: ^3.1
- php-http/guzzle6-adapter: ^1.1
- php-http/mock-client: ^1.0
This package is auto-updated.
Last update: 2023-01-06 05:27:02 UTC
README
❗️ 提供通过Pushover发送消息的功能
要求
- PHP >= 7.1
安装
composer require brunty/pushover
您还需要要求您选择的适配器 http://docs.php-http.org/en/latest/clients.html
用法
根据Pushover API 文档 - user
和 token
是您的凭证。
消息由一个消息体和一个标题组成,在 Brunty\Pushover\Message
对象中。
您还可以指定发送消息的设备,如果不指定,则发送到所有设备。
<?php use Brunty\Pushover\Client; use Brunty\Pushover\Credentials; use Brunty\Pushover\Message; use Http\Mock\Client as MockClient; // Mock client here wouldn't send a request, it's used for testing // substitute with your own real client from the adapters above $client = new Client(new MockClient, new Credentials('user', 'token')); $client->pushMessage(new Message('message', 'optional title'), 'optional device');
以下功能(尚未)支持,但将在不久的将来支持
url
url_title
priority
timestamp
sound
贡献
这最初是一个小的个人项目。
尽管这个项目很小,但开放性和包容性被认真对待。为此,已经采用了行为准则(在贡献指南中列出)。