tykfyr/ntfy-php
最新稳定版本:v1.0.1
Composer 安装命令:
composer require tykfyr/ntfy-php
包简介
Simple PHP wrapper for ntfy.sh.
README 文档
README
A simple PHP wrapper for ntfy.sh – send push notification directly from PHP.
🚀 Installation
composer require tykfyr/ntfy-php
📦 Usage
use Tykfyr\Ntfy\Client; $ntfy = new Client('my-topic'); $ntfy->send('Backup job finished!'); $ntfy->send('Deployment failed!', [ 'priority' => 5, 'title' => '🚨 Fejl i deployment', 'tags' => ['warning', 'deploy'], 'click' => 'https://example.com/status' ]);
⚙️ Configuration
You can set the default topic and server URL in the constructor:
$ntfy = new Client('alerts', [ 'base_url' => 'https://ntfy.example.com', 'auth' => 'Bearer your-token' ]);
🧪 Test
You can run the tests using PHPUnit. Make sure you have PHPUnit installed and run:
vendor/bin/phpunit
🧠 More information
- Documentation for headers: https://docs.ntfy.sh/publish/#using-http
- This client uses Guzzle for HTTP requests, so you can use all Guzzle features.
📝 License
This project is licensed under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-07