改进 命令处理为 pipe
This commit is contained in:
parent
39fd536bae
commit
3f49a92e28
@ -125,7 +125,6 @@ public function handle(): int
|
||||
$this->pipeCommand($command);
|
||||
|
||||
} else {
|
||||
// 子进程
|
||||
$this->report();
|
||||
}
|
||||
|
||||
@ -228,5 +227,17 @@ private function pipeCommand($command): void
|
||||
echo $s;
|
||||
}
|
||||
}
|
||||
|
||||
// 命令结束后,关闭管道
|
||||
fclose($pipes[0]);
|
||||
|
||||
fclose($pipes[1]);
|
||||
|
||||
fclose($pipes[2]);
|
||||
|
||||
// 关闭进程
|
||||
|
||||
proc_close($process);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user