PHP code example of gipfl / systemd

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

    

gipfl / systemd example snippets




use gipfl\SystemD\NotifySystemD;
use React\EventLoop\Factory as Loop;

$loop = Loop::create();
if ($notifier = NotifySystemD::ifRequired($loop)) {
    $notifier->setReady('My process is ready');
    $loop->addTimer(10, function () use ($notifier) {
        $notifier->setStatus('Process status changed');
    });
}

$loop->run();