PHP code example of manzadey / sentry-cron-monitor

1. Go to this page and download the library: Download manzadey/sentry-cron-monitor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

manzadey / sentry-cron-monitor example snippets


use Manzadey\SentryCronMonitor\CronMonitor;

$monitor = new CronMonitor('dsn');

$monitor->progress('monitorId');
// Get data from progress request
$monitor->getDataProgress();

// our code...

// if a failure is detected in the execution of the task
$monitor->error();

// Get data from error request
$monitor->getDataError();

// or if your task is completed successfully
$monitor->ok(); 

// Get data from ok request
$monitor->getDataOk();

// Get all data from requests
$monitor->getData();

// get exception errors
$monitor->getErrors();

// check exception errors
$monitor->hasErrors();