public function __destruct() { $this->onBatchDown(); KScheduleHelperManager::unlinkRunningBatch($this->getName(), $this->getIndex()); }
public function _cleanup() { if ($this->pipes) { foreach ($this->pipes as $index => $ref) { if (is_resource($ref)) { fclose($ref); } } unset($this->pipes); $this->pipes = null; } if ($this->isMockedProcess) { $this->killProcess(); KScheduleHelperManager::unlinkRunningBatch($this->taskConfig->name, $this->taskConfig->getTaskIndex()); return; } if ($this->handle && is_resource($this->handle)) { $status = proc_get_status($this->handle); if (!$status['running']) { return; } $this->killProcess(); proc_terminate($this->handle); proc_close($this->handle); $this->handle = null; } }