Changeset View
Changeset View
Standalone View
Standalone View
src/future/exec/ExecFuture.php
Show First 20 Lines • Show All 811 Lines • ▼ Show 20 Lines | public function isReady() { | ||||
if ($max_stderr_read_bytes > 0) { | if ($max_stderr_read_bytes > 0) { | ||||
$this->stderr .= $this->readAndDiscard( | $this->stderr .= $this->readAndDiscard( | ||||
$stderr, | $stderr, | ||||
$this->getStderrSizeLimit() - strlen($this->stderr), | $this->getStderrSizeLimit() - strlen($this->stderr), | ||||
'stderr', | 'stderr', | ||||
$max_stderr_read_bytes); | $max_stderr_read_bytes); | ||||
} | } | ||||
$is_done = false; | |||||
if (!$status['running']) { | if (!$status['running']) { | ||||
// We may still have unread bytes on stdout or stderr, particularly if | |||||
// this future is being buffered and streamed. If we do, we don't want to | |||||
// consider the subprocess to have exited until we've read everything. | |||||
// See T9724 for context. | |||||
if (feof($stdout) && feof($stderr)) { | |||||
$is_done = true; | |||||
} | |||||
} | |||||
if ($is_done) { | |||||
if ($this->useWindowsFileStreams) { | if ($this->useWindowsFileStreams) { | ||||
fclose($stdout); | fclose($stdout); | ||||
fclose($stderr); | fclose($stderr); | ||||
} | } | ||||
$this->result = array( | $this->result = array( | ||||
$status['exitcode'], | $status['exitcode'], | ||||
$this->stdout, | $this->stdout, | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |