Changeset 4367 in subversion
- Timestamp:
- Dec 23, 2010 1:25:18 PM (2 years ago)
- Location:
- trunk/roundcubemail/program/include
- Files:
-
- 3 edited
-
rcmail.php (modified) (1 diff)
-
rcube_imap.php (modified) (7 diffs)
-
rcube_imap_generic.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcmail.php
r4363 r4367 504 504 'auth_cid' => $this->config->get('imap_auth_cid'), 505 505 'auth_pw' => $this->config->get('imap_auth_pw'), 506 'debug _mode'=> (bool) $this->config->get('imap_debug', 0),506 'debug' => (bool) $this->config->get('imap_debug', 0), 507 507 'force_caps' => (bool) $this->config->get('imap_force_caps'), 508 508 'timeout' => (int) $this->config->get('imap_timeout', 0), -
trunk/roundcubemail/program/include/rcube_imap.php
r4344 r4367 149 149 $this->options['port'] = $port; 150 150 151 if ($this->options['debug']) 152 $this->conn->setDebug(true, array($this, 'debug_handler')); 153 151 154 $attempt = 0; 152 155 do { … … 224 227 function get_error_code() 225 228 { 226 return ($this->conn) ? $this->conn->errornum : 0;229 return $this->conn->errornum; 227 230 } 228 231 … … 235 238 function get_error_str() 236 239 { 237 return ($this->conn) ? $this->conn->error : null;240 return $this->conn->error; 238 241 } 239 242 … … 246 249 function get_response_code() 247 250 { 248 if (!$this->conn)249 return self::UNKNOWN;250 251 251 switch ($this->conn->resultcode) { 252 252 case 'NOPERM': … … 279 279 function get_response_str() 280 280 { 281 return ($this->conn) ? $this->conn->result : null;281 return $this->conn->result; 282 282 } 283 283 … … 547 547 $imap_delimiter = $config->get('imap_delimiter'); 548 548 549 if (!$this->conn )549 if (!$this->conn->connected()) 550 550 return; 551 551 … … 4741 4741 } 4742 4742 4743 4744 /** 4745 * This is our own debug handler for the IMAP connection 4746 * @access public 4747 */ 4748 public function debug_handler(&$imap, $message) 4749 { 4750 write_log('imap', $message); 4751 } 4752 4743 4753 } // end class rcube_imap 4744 4754 -
trunk/roundcubemail/program/include/rcube_imap_generic.php
r4360 r4367 110 110 private $cmd_tag; 111 111 private $cmd_num = 0; 112 private $_debug = false; 113 private $_debug_handler = false; 112 114 113 115 const ERROR_OK = 0; … … 143 145 return false; 144 146 145 if ( !empty($this->prefs['debug_mode'])) {146 write_log('imap','C: '. rtrim($string));147 if ($this->_debug) { 148 $this->debug('C: '. rtrim($string)); 147 149 } 148 150 … … 232 234 break; 233 235 } 234 if ( !empty($this->prefs['debug_mode'])) {235 write_log('imap','S: '. rtrim($buffer));236 if ($this->_debug) { 237 $this->debug('S: '. rtrim($buffer)); 236 238 } 237 239 $line .= $buffer; … … 269 271 { 270 272 $d = fread($this->fp, $bytes-$len); 271 if ( !empty($this->prefs['debug_mode'])) {272 write_log('imap','S: '. $d);273 if ($this->_debug) { 274 $this->debug('S: '. $d); 273 275 } 274 276 $data .= $d; … … 687 689 $line = trim(fgets($this->fp, 8192)); 688 690 689 if ($this-> prefs['debug_mode']&& $line) {690 write_log('imap','S: '. $line);691 if ($this->_debug && $line) { 692 $this->debug('S: '. $line); 691 693 } 692 694 … … 3239 3241 } 3240 3242 3243 /** 3244 * Set the value of the debugging flag. 3245 * 3246 * @param boolean $debug New value for the debugging flag. 3247 * 3248 * @access public 3249 * @since 0.5-stable 3250 */ 3251 function setDebug($debug, $handler = null) 3252 { 3253 $this->_debug = $debug; 3254 $this->_debug_handler = $handler; 3255 } 3256 3257 /** 3258 * Write the given debug text to the current debug output handler. 3259 * 3260 * @param string $message Debug mesage text. 3261 * 3262 * @access private 3263 * @since 0.5-stable 3264 */ 3265 private function debug($message) 3266 { 3267 if ($this->_debug_handler) { 3268 call_user_func_array($this->_debug_handler, array(&$this, $message)); 3269 } else { 3270 echo "DEBUG: $message\n"; 3271 } 3272 } 3273 3241 3274 }
Note: See TracChangeset
for help on using the changeset viewer.
