PHP code example of maksslesarenko / emdrive

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

    

maksslesarenko / emdrive example snippets


use Emdrive\Command\ScheduledCommandInterface;
use Emdrive\InterruptableExecutionTrait;
use Emdrive\LockableExecutionTrait;
use Symfony\Component\Console\Command\Command;

class FisrtScheduledCommand extends Command implements ScheduledCommandInterface
{
    use LockableExecutionTrait;
    use InterruptableExecutionTrait;

    public function configure()
    {
        $this->setName('first-scheduled-command');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {        
        ...
        foreach ($collection as $item) {
            if ($this->isInterrupted()) {
                break;
            }
            ...
        }
    }
}