Open PV-Patrick opened 7 years ago
I'm currently having problems getting the closure to be called at all.
However, I would expect the following to work:
$response = '';
SSH::into('sftp')->task('myTask', function($line) use(&$response)
{
$response = $line;
});
return $response;
Thank you @ewstefan !! That worked!
Is it possible to catch the output of the command in a variable to be used elsewhere in the method?
Instead of echo $line.PHP_EOL; --> $str .= $line; ?