You are here

public function Process::getIncrementalOutput in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Process.php \Symfony\Component\Process\Process::getIncrementalOutput()

Returns the output incrementally.

In comparison with the getOutput method which always return the whole output, this one returns the new output since the last call.

Return value

string The process output since the last call

Throws

LogicException in case the output has been disabled

LogicException In case the process is not started

File

vendor/symfony/process/Process.php, line 485

Class

Process
Process is a thin wrapper around proc_* functions to easily start independent PHP processes.

Namespace

Symfony\Component\Process

Code

public function getIncrementalOutput() {
  $this
    ->requireProcessIsStarted(__FUNCTION__);
  $data = $this
    ->getOutput();
  $latest = substr($data, $this->incrementalOutputOffset);
  if (false === $latest) {
    return '';
  }
  $this->incrementalOutputOffset = strlen($data);
  return $latest;
}