PHP code example of binarybuilds / cronbuzz-php

1. Go to this page and download the library: Download binarybuilds/cronbuzz-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/ */

    

binarybuilds / cronbuzz-php example snippets


\BinaryBuilds\CronBuzzPHP\CronBuzzTask::run('your-monitor-uuid', function (){

    // Add your code here
        
});


$run = new \BinaryBuilds\CronBuzzPHP\Run( 'your-monitor-uuid' );
$run->start();

try{
   
    // Add your code here

    $run->complete();

}catch (\Exception $exception){

    $run->fail( $exception->getMessage() );
    
    // Handle your exceptions here    
}


\BinaryBuilds\CronBuzzPHP\CronBuzzAPI::setTeamKey('your-team-key');
\BinaryBuilds\CronBuzzPHP\CronBuzzAPI::setApiKey('your-api-token');

\BinaryBuilds\CronBuzzPHP\Monitor::list();

\BinaryBuilds\CronBuzzPHP\Monitor::get( 'monitor id');

\BinaryBuilds\CronBuzzPHP\Monitor::create(
    'monitor name', 
    'schedule', 
    'max execution', 
    'notification lists', 
    'tags'
);

\BinaryBuilds\CronBuzzPHP\Monitor::update( 'monitor id', 'fields');

\BinaryBuilds\CronBuzzPHP\Monitor::delete( 'monitor id');

\BinaryBuilds\CronBuzzPHP\Monitor::pause( 'monitor id');

\BinaryBuilds\CronBuzzPHP\Monitor::resume( 'monitor id');

\BinaryBuilds\CronBuzzPHP\NotificationList::list();

\BinaryBuilds\CronBuzzPHP\NotificationList::get( 'list id');

\BinaryBuilds\CronBuzzPHP\NotificationList::create( 'list name', 'channels');

[
    [ 'type' => 'EMAIL', '[email protected]'],
    [ 'type' => 'WEBHOOK', 'https://your-webhook-url.com/'],
]

\BinaryBuilds\CronBuzzPHP\NotificationList::update( 'list id', 'new name');

\BinaryBuilds\CronBuzzPHP\NotificationList::delete( 'list id');

\BinaryBuilds\CronBuzzPHP\Tag::list();

\BinaryBuilds\CronBuzzPHP\Tag::get( 'tag id');

\BinaryBuilds\CronBuzzPHP\Tag::create( 'tag name');

\BinaryBuilds\CronBuzzPHP\Tag::update( 'tag id', 'new name');

\BinaryBuilds\CronBuzzPHP\Tag::delete( 'tag id');
bash
composer