Skip to content

Commit b8c4066

Browse files
committed
Merge pull request #63 from mekras/show_error_output
Show failure reasons
2 parents 563dc8e + 0e6667e commit b8c4066

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/Pomander/RemoteShell.php

+14-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33

44
class RemoteShell
55
{
6-
protected $host, $port, $user, $auth, $shell, $key_pass;
6+
/**
7+
* SSH
8+
*
9+
* @var \Net_SSH2
10+
*/
11+
protected $shell;
12+
13+
protected $host, $port, $user, $auth, $key_pass;
714

815
public function __construct($host, $port, $user, $auth, $key_pass)
916
{
@@ -52,6 +59,11 @@ protected function connect()
5259
abort("ssh", "Login failed.");
5360
}
5461

62+
/**
63+
* Process remote command execution
64+
*
65+
* @return string
66+
*/
5567
protected function process()
5668
{
5769
$output = "";
@@ -61,9 +73,8 @@ protected function process()
6173
$temp = $this->shell->_get_channel_packet(NET_SSH2_CHANNEL_EXEC);
6274
switch( true ) {
6375
case $temp === true:
64-
return $output;
6576
case $temp === false:
66-
return false;
77+
return $output;
6778
default:
6879
$output .= $temp;
6980
if( $this->handle_data(substr($output, $offset)) ) {

0 commit comments

Comments
 (0)