Getting SSH output "as it happens" via PHP? -


i've used libraries fabric (python) perform various tasks on remote server. when run tasks via library, output remote server actions happening. example, if task executing git pull on server, line line output of happens.

however, when @ various php ssh libs , ssh2 extension. appears there way of output of command after has happened, in 1 long string. fed output remote server task running. possible? in pseudocode, kind of i'm looking for:

server::run('git pull origin master', function($output) {      echo $output.php_eol; }); 

got working. can read stream returned ssh2_exec using fgets in loop.


Comments