| | |
| | | } |
| | | |
| | | 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" : '')); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | function iil_ReadLine($fp, $size=1024) { |
| | | global $my_prefs; |
| | | |
| | | $line = ''; |
| | | |
| | | if (!$fp) { |
| | |
| | | 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"); |
| | | |
| | |
| | | } |
| | | |
| | | function iil_ReadBytes($fp, $bytes) { |
| | | global $my_prefs; |
| | | $data = ''; |
| | | $len = 0; |
| | | do { |
| | |
| | | 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); |
| | | |
| | |
| | | $my_prefs['rootdir'] = $optval; |
| | | } else if ($optkey == 'delimiter') { |
| | | $my_prefs['delimiter'] = $optval; |
| | | } else if ($optkey == 'debug_mode') { |
| | | $my_prefs['debug_mode'] = $optval; |
| | | } |
| | | } |
| | | } |