PHP code example of primipilus / daemon

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

    

primipilus / daemon example snippets


class TestDaemon extends \primipilus\daemon\BaseDaemon
{

    protected function process() : void
    {
       // ...
    }
}

$daemon = new TestDaemon(['daemonize' => true, 'runtimeDir' => __DIR__]);

$daemon->start();
// or
$daemon->stop();