1. Go to this page and download the library: Download mrden/demonizer 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/ */
mrden / demonizer example snippets
namespace Any;
class SingleDaemonProcess extends \Mrden\Demonizer\Contracts\DaemonProcess
{
use \Mrden\Forker\Traits\ProcessFileStorageTrait;
/**
* in sec
*/
protected $period = 5;
protected function job(): void
{
echo 'I\'m the code of iteration daemon process';
}
protected function checkParams(): void
{
}
protected function prepare(): void
{
}
}
$singleProcess = new \Any\SingleDaemonProcess();
$forker = new \Mrden\Forker\Forker($singleProcess);
$forker->run(3);