From 879a5c4364e0da076d78356f43301efa97c95f27 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 23 Jul 2012 07:17:53 -0500 Subject: [PATCH] - add enableQuietMode to suppress stderr --- phpseclib/Net/SSH2.php | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index f7d0ed89..c8a5256e 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -687,6 +687,14 @@ class Net_SSH2 { */ var $realtime_log_wrap; + /** + * Flag to suppress stderr from output + * + * @see Net_SSH2::enableQuiteMode() + * @access private + */ + var $quiet_mode = false; + /** * Default Constructor. * @@ -2123,6 +2131,30 @@ class Net_SSH2 { return $payload; } + /** + * Enable Quiet Mode + * + * Suppress stderr from output + * + * @access public + */ + function enableQuietMode() + { + $this->quiet_mode = true; + } + + /** + * Disable Quiet Mode + * + * Show stderr in output + * + * @access public + */ + function disableQuietMode() + { + $this->quiet_mode = false; + } + /** * Gets channel data * @@ -2221,7 +2253,7 @@ class Net_SSH2 { $this->channel_buffers[$client_channel][] = $data; break; case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA: - if ($skip_extended) { + if ($skip_extended || $this->quiet_mode) { break; } /*