model::INTEGER, 'target' => model::STRING, 'name' => model::STRING, 'time_created' => model::INTEGER, 'time_started' => model::INTEGER, 'time_finished' => model::INTEGER, 'status' => model::STRING, // ENUM 'result' => model::STRING, // ENUM 'return_code' => model::INTEGER, 'sig' => model::STRING, 'stdout' => model::STRING, 'stderr' => model::STRING, 'input' => model::SERIALIZED, ]; public $id; public $target; public $name; public $timeCreated; public $timeStarted; public $timeFinished; public $status; public $result; public $returnCode; public $sig; public $stdout; public $stderr; public $input; abstract public function run(); public function __construct(array $raw) { parent::__construct($raw); if (PHP_SAPI === 'cli') { pcntl_async_signals(true); pcntl_signal(SIGTERM, [$this, 'signalHandler']); pcntl_signal(SIGINT, [$this, 'signalHandler']); } } protected function signalHandler(int $signal) {} }