Пример #1
0
 /**
  * Terminates the process and deletes the temporary files
  * @param string $fileId the unique file id generated by ProcMonitor::Start
  * @param int $procId the pid of the process to kill
  * @see ProcMonitor::Start()
  */
 public function Close($fileId, $procId)
 {
     posix_kill($procId, 15);
     unlink(ProcMonitor::GetFName($fileId));
     unlink(ProcMonitor::GetBytesFName($fileId));
 }
Пример #2
0
<?php

include "ProcMonitor.class.php";
list($fileId, $procId) = ProcMonitor::Start("locate home");
while (ProcMonitor::Running($procId) || ProcMonitor::OutputWaiting($fileId)) {
    print ProcMonitor::GetOutput($fileId);
}
ProcMonitor::Close($fileId, $procId);