Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 protected function getIndex()
 {
     return self::$taskConfig->getTaskIndex();
 }
 /**
  * @return int the batch instance index
  */
 public function getIndex()
 {
     return $this->taskConfig->getTaskIndex();
 }
 protected function getIndex()
 {
     return $this->taskConfig->getTaskIndex();
 }