LaravelCollective / remote

Remote SSH Access for the Laravel Framework
MIT License
276 stars 106 forks source link

Tasks do not work #43

Closed mabasic closed 7 years ago

mabasic commented 7 years ago

I have defined a task:

Route::get('/task', function() {
    \SSH::into('myserver')->define('list', [
        'cd /',
        'ls -all'
    ]);

    \SSH::into('myserver')->task('list', function($line)
    {
        echo $line.PHP_EOL;
    });
});

When I visit /task in the browser it immediately shows an empty page, but when I run:

Route::get('/output', function() {
    $commands = [
        'cd /',
        'ls -all'
    ];

    \SSH::run($commands, function($line)
    {
        echo $line.PHP_EOL;
    });
});

it works, so I know that the connection is successful.

Any help?

mlantz commented 7 years ago

https://laravelcollective.com/docs/5.4/ssh#tasks