diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-07 16:38:31 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-07 16:38:31 +0000 |
| commit | 7855a5d2f87cf1907a8eb4ddc3d55a8f27d3f9ff (patch) | |
| tree | 2be122c6d3443cee1ee3c45081e975785f268f16 /roundcubemail/program/lib | |
| parent | 8fff54e72bc627e608a7b8fde238551d4e36bc2c (diff) | |
- Added 'imap_debug' option, described 'sql_debug' option in config file
git-svn-id: https://svn.roundcube.net/trunk@2719 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib')
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index 7b40c020b..a8f858ea6 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -197,7 +197,11 @@ function iil_xor($string, $string2) { } function iil_PutLine($fp, $string, $endln=true) { -// console('C: '. rtrim($string)); + global $my_prefs; + + if(!empty($my_prefs['debug_mode'])) + write_log('imap', 'C: '. rtrim($string)); + return fputs($fp, $string . ($endln ? "\r\n" : '')); } @@ -225,6 +229,8 @@ function iil_PutLineC($fp, $string, $endln=true) { } function iil_ReadLine($fp, $size=1024) { + global $my_prefs; + $line = ''; if (!$fp) { @@ -240,7 +246,8 @@ function iil_ReadLine($fp, $size=1024) { if ($buffer === false) { break; } -// console('S: '. chop($buffer)); + if(!empty($my_prefs['debug_mode'])) + write_log('imap', 'S: '. chop($buffer)); $line .= $buffer; } while ($buffer[strlen($buffer)-1] != "\n"); @@ -265,6 +272,7 @@ function iil_MultLine($fp, $line, $escape=false) { } function iil_ReadBytes($fp, $bytes) { + global $my_prefs; $data = ''; $len = 0; do { @@ -273,7 +281,8 @@ function iil_ReadBytes($fp, $bytes) { if ($len == strlen($data)) { break; //nothing was read -> exit to avoid apache lockups } -// console('[...] '. $d); + if(!empty($my_prefs['debug_mode'])) + write_log('imap', 'S: '. $d); $len = strlen($data); } while ($len < $bytes); @@ -553,6 +562,8 @@ function iil_Connect($host, $user, $password, $options=null) { $my_prefs['rootdir'] = $optval; } else if ($optkey == 'delimiter') { $my_prefs['delimiter'] = $optval; + } else if ($optkey == 'debug_mode') { + $my_prefs['debug_mode'] = $optval; } } } |
