From 915f3fc7e97342c84c9a9555090401e6b70deeeb Mon Sep 17 00:00:00 2001 From: wvfeng <33809027+wvfeng@users.noreply.github.com> Date: Tue, 6 Jul 2021 15:44:07 +0800 Subject: [PATCH] fix blocks infinitly under Windows It seems that stream_get_contents() on STDOUT blocks infinitly under Windows when STDERR is filled under some circumstances. reference: https://www.php.net/manual/zh/function.proc-open.php#97012 --- src/JonnyW/PhantomJs/Procedure/Procedure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JonnyW/PhantomJs/Procedure/Procedure.php b/src/JonnyW/PhantomJs/Procedure/Procedure.php index 633312f2..3f98070f 100644 --- a/src/JonnyW/PhantomJs/Procedure/Procedure.php +++ b/src/JonnyW/PhantomJs/Procedure/Procedure.php @@ -101,7 +101,7 @@ public function run(InputInterface $input, OutputInterface $output) $descriptorspec = array( array('pipe', 'r'), array('pipe', 'w'), - array('pipe', 'w') + array('pipe', 'a') ); $process = proc_open(escapeshellcmd(sprintf('%s %s', $this->engine->getCommand(), $executable)), $descriptorspec, $pipes, null, null);