gioco-plus / grabber-log
此包最新版本(v2.3.1)没有可用的许可信息。
v2.3.1
2023-05-05 03:10 UTC
Requires
- php: >=7.2
- gioco-plus/prism-plus: dev-master || >=1
README
初始化
use GiocoPlus\GrabberLog\GrabberLog;
/** * GrabberLog constructor. * @param string $vendorCode * @param array $options * @throws \Exception */ $grabberLog = new GrabberLog($vendorCode, $options);
参数说明
$options
例如:$options['agent']
所有参数都是可选的
记录开始
$grabberLog->running($start, $extraParams);
参数说明
记录结束(成功)
$grabberLog->complete($extraParams);
参数说明
记录结束(失败)
$grabberLog->fail($extraParams, $options);
参数说明
$extraParams
例如:$extraParams['error_message']
所有参数都是可选的
$options
例如:$options['maintain']
所有参数都是可选的
额外功能
获取最后一条 grabber log
$grabberLog->lastLog($filter);
参数说明
获取下次抓取时间
仅适用于日志中包含
start
、end
nextGrabber,返回 Carbon
nextGrabberTime,返回 10 位的时间戳
['start' => $startTime, 'end' => $endTime] = $grabberLog->nextGrabberTime( $pastMinutes, $longTimeRang, ['bufferNowMin' => $bufferMin] );
参数说明
$options