PHP code example of shippinno / heartbeat

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

    

shippinno / heartbeat example snippets


$heartbeater = Heartbeater::instance();
$heartbeater->setHeart(new DeadMansSnitchHeart(new Client);
$heartbeater->setChannels([
    'vital' => 'SNITCH_TOKEN',
]);

class Dude
{
    public function live()
    {
        $alive = true;
        while ($alive) {
            Heartbeat::instance()->heartbeat('vital');
            sleep(1);
        }
    }
}