mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-04 20:47:54 +00:00
SFTP: clean up real time logging
This commit is contained in:
parent
cfa7d491bf
commit
c21147a5bd
@ -3065,9 +3065,17 @@ class Net_SFTP extends Net_SSH2
|
|||||||
$packet_type = '-> ' . $this->packet_types[$type] .
|
$packet_type = '-> ' . $this->packet_types[$type] .
|
||||||
' (' . round($stop - $start, 4) . 's)';
|
' (' . round($stop - $start, 4) . 's)';
|
||||||
if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
|
if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
|
||||||
echo "<pre>\r\n" . $this->_format_log(array($data), array($packet_type)) . "\r\n</pre>\r\n";
|
switch (PHP_SAPI) {
|
||||||
flush();
|
case 'cli':
|
||||||
ob_flush();
|
$start = $stop = "\r\n";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$start = '<pre>';
|
||||||
|
$stop = '</pre>';
|
||||||
|
}
|
||||||
|
echo $start . $this->_format_log(array($data), array($packet_type)) . $stop;
|
||||||
|
@flush();
|
||||||
|
@ob_flush();
|
||||||
} else {
|
} else {
|
||||||
$this->packet_type_log[] = $packet_type;
|
$this->packet_type_log[] = $packet_type;
|
||||||
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
||||||
@ -3174,9 +3182,17 @@ class Net_SFTP extends Net_SSH2
|
|||||||
$packet_type = '<- ' . $this->packet_types[$this->packet_type] .
|
$packet_type = '<- ' . $this->packet_types[$this->packet_type] .
|
||||||
' (' . round($stop - $start, 4) . 's)';
|
' (' . round($stop - $start, 4) . 's)';
|
||||||
if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
|
if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
|
||||||
echo "<pre>\r\n" . $this->_format_log(array($packet), array($packet_type)) . "\r\n</pre>\r\n";
|
switch (PHP_SAPI) {
|
||||||
flush();
|
case 'cli':
|
||||||
ob_flush();
|
$start = $stop = "\r\n";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$start = '<pre>';
|
||||||
|
$stop = '</pre>';
|
||||||
|
}
|
||||||
|
echo $start . $this->_format_log(array($packet), array($packet_type)) . $stop;
|
||||||
|
@flush();
|
||||||
|
@ob_flush();
|
||||||
} else {
|
} else {
|
||||||
$this->packet_type_log[] = $packet_type;
|
$this->packet_type_log[] = $packet_type;
|
||||||
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
||||||
|
Loading…
Reference in New Issue
Block a user