I've used libraries like Fabric (Python) to perform various tasks on a remote server. When I run tasks via this library, I get the output from the remote server as the actions are happening. For example, if the task is executing a git pull
on the server, I get the line by line output of that as it happens.
However, when I look at the various PHP SSH libs and the SSH2 extension. It appears there is only a way to get ALL of the output of from the command after it has already happened, in one long string. I would like to be fed output back from the remote server as the task is running. Is this possible? In pseudocode, this is kind of what I'm looking for:
Server::run('git pull origin master', function($output)
{
echo $output.PHP_EOL;
});