Changeset View
Changeset View
Standalone View
Standalone View
src/future/exec/ExecFuture.php
Context not available. | |||||
$result = array( | $result = array( | ||||
$stdout, | $stdout, | ||||
(string)substr($this->stderr, $this->stderrPos), | (string)@substr($this->stderr, $this->stderrPos), | ||||
); | ); | ||||
$this->stderrPos = strlen($this->stderr); | $this->stderrPos = @strlen($this->stderr); | ||||
return $result; | return $result; | ||||
} | } | ||||
Context not available. | |||||
$this->updateFuture(); // Sync | $this->updateFuture(); // Sync | ||||
} | } | ||||
$result = (string)substr($this->stdout, $this->stdoutPos); | $result = (string)@substr($this->stdout, $this->stdoutPos); | ||||
$this->stdoutPos = strlen($this->stdout); | $this->stdoutPos = @strlen($this->stdout); | ||||
return $result; | return $result; | ||||
} | } | ||||
Context not available. | |||||
* @task interact | * @task interact | ||||
*/ | */ | ||||
public function write($data, $keep_pipe = false) { | public function write($data, $keep_pipe = false) { | ||||
if (strlen($data)) { | if (@strlen($data)) { | ||||
if (!$this->stdin) { | if (!$this->stdin) { | ||||
throw new Exception(pht('Writing to a closed pipe!')); | throw new Exception(pht('Writing to a closed pipe!')); | ||||
} | } | ||||
Context not available. | |||||
*/ | */ | ||||
public function resolveJSON() { | public function resolveJSON() { | ||||
list($stdout, $stderr) = $this->resolvex(); | list($stdout, $stderr) = $this->resolvex(); | ||||
if (strlen($stderr)) { | if (@strlen($stderr)) { | ||||
$cmd = $this->getCommand(); | $cmd = $this->getCommand(); | ||||
throw new CommandException( | throw new CommandException( | ||||
pht( | pht( | ||||
Context not available. | |||||
* @task internal | * @task internal | ||||
*/ | */ | ||||
public function isReadBufferEmpty() { | public function isReadBufferEmpty() { | ||||
return !strlen($this->stdout); | return !@strlen($this->stdout); | ||||
} | } | ||||
Context not available. | |||||
throw new Exception(pht('Failed to read from %s', $description)); | throw new Exception(pht('Failed to read from %s', $description)); | ||||
} | } | ||||
$read_bytes = strlen($data); | $read_bytes = @strlen($data); | ||||
if ($read_bytes > 0 && $limit > 0) { | if ($read_bytes > 0 && $limit > 0) { | ||||
if ($read_bytes > $limit) { | if ($read_bytes > $limit) { | ||||
$data = substr($data, 0, $limit); | $data = @substr($data, 0, $limit); | ||||
} | } | ||||
$output .= $data; | $output .= $data; | ||||
$limit -= strlen($data); | $limit -= @strlen($data); | ||||
} | } | ||||
if (strlen($output) >= $length) { | if (@strlen($output) >= $length) { | ||||
break; | break; | ||||
} | } | ||||
} while ($read_bytes > 0); | } while ($read_bytes > 0); | ||||
Context not available. | |||||
$max_stdout_read_bytes = PHP_INT_MAX; | $max_stdout_read_bytes = PHP_INT_MAX; | ||||
$max_stderr_read_bytes = PHP_INT_MAX; | $max_stderr_read_bytes = PHP_INT_MAX; | ||||
if ($read_buffer_size !== null) { | if ($read_buffer_size !== null) { | ||||
$max_stdout_read_bytes = $read_buffer_size - strlen($this->stdout); | $max_stdout_read_bytes = $read_buffer_size - @strlen($this->stdout); | ||||
$max_stderr_read_bytes = $read_buffer_size - strlen($this->stderr); | $max_stderr_read_bytes = $read_buffer_size - @strlen($this->stderr); | ||||
} | } | ||||
if ($max_stdout_read_bytes > 0) { | if ($max_stdout_read_bytes > 0) { | ||||
$this->stdout .= $this->readAndDiscard( | $this->stdout .= $this->readAndDiscard( | ||||
$stdout, | $stdout, | ||||
$this->getStdoutSizeLimit() - strlen($this->stdout), | $this->getStdoutSizeLimit() - @strlen($this->stdout), | ||||
'stdout', | 'stdout', | ||||
$max_stdout_read_bytes); | $max_stdout_read_bytes); | ||||
} | } | ||||
Context not available. | |||||
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); | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0