gioco-plus/grabber-log

There is no license information available for the latest version (v2.4.1) of this package.

v2.4.1 2024-12-31 03:56 UTC

This package is auto-updated.

Last update: 2024-12-31 03:57:57 UTC


README

初始化

use GiocoPlus\GrabberLog\GrabberLog;
/**
 * GrabberLog constructor.
 * @param string $vendorCode
 * @param array $options
 * @throws \Exception
 */
 
$grabberLog = new GrabberLog($vendorCode, $options);

參數說明

$options

ex: $options['agent']

參數皆為選填

紀錄開始

$grabberLog->running($start, $extraParams);

參數說明

紀錄結束 (成功)

$grabberLog->complete($extraParams);

參數說明

紀錄結束 (失敗)

$grabberLog->fail($extraParams, $options);

參數說明

$extraParams

ex: $extraParams['error_message']

參數皆為選填

$options

ex: $options['maintain']

參數皆為選填

額外功能

取得最後一筆 grabber log

$grabberLog->lastLog($filter);

參數說明

取得下次抓取時間

僅適用 log 內有 startend

nextGrabber , 返回 Carbon

nextGrabberTime , 返回 timestamp 10 位

['start' => $startTime, 'end' => $endTime] = $grabberLog->nextGrabberTime(
                    $pastMinutes,
                    $longTimeRang,
                    ['bufferNowMin' => $bufferMin]
                );

參數說明

$options