1. Go to this page and download the library: Download cronbeats/cronbeats-php 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/ */
cronbeats / cronbeats-php example snippets
ronBeats\PingSdk\PingClient;
$client = new PingClient('abc123de', [
'baseUrl' => 'https://cronbeats.io',
'timeoutMs' => 5000,
'maxRetries' => 2,
]);
// Simple heartbeat
$client->ping();
// Start/end signals
$client->start();
// ... do work ...
$client->success();
$client = new PingClient('abc123de');
$client->start();
try {
// your actual cron work
processEmails();
$client->success();
} catch (Exception $e) {
$client->fail();
}
// Percentage mode: 0-100 with message
$client->progress(50, 'Processing batch 500/1000');
// Or using options array
$client->progress([
'seq' => 75,
'message' => 'Almost done - 750/1000',
]);
// Message-only mode: null seq, just status updates
$client->progress(null, 'Connecting to database...');
$client->progress(null, 'Starting data sync...');