pluswerk / uptime-robot
一个用于调用uptime-robot心跳统一的简单包装器
3.0.0
2024-06-13 15:00 UTC
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
- psr/log: ^1 || ^2 || ^3
Requires (Dev)
- pluswerk/grumphp-config: ^6.0 || ^7.0
This package is auto-updated.
Last update: 2024-09-13 15:39:37 UTC
README
此包封装了另一个PHP函数来创建并发送uptime-robot的心跳,并在请求未成功时记录警告。
从1升级到2
已不再存在HeartBeatException
。如果您想记录对uptime-robot的请求失败,需要在构造函数中注入一个\Psr\Log\LoggerInterface
。
安装
composer req pluswerk/uptime-robot
用法
向UptimeRobot发送请求
$heartBeat = new HeartBeat(); $heartBeat->alive('https://heartbeat.uptimerobot.com/m0000000000-0000000000000000000000000');
使用给定的时间限制您的请求
$heartBeat->throttledAlive($yourUptimeUrl, 300);