diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-23 18:25:18 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-23 18:25:18 +0000 |
| commit | b3c6452026544454e383aa58a40ff0c7dc865e09 (patch) | |
| tree | 16a0a1ed98e1db0683de77754603e8f4dc9481a4 /roundcubemail/program/include/rcube_imap.php | |
| parent | 35815c0a2869d117cce869f5d7b6cc174b413822 (diff) | |
- Add debug handler support in rcube_imap_generic
git-svn-id: https://svn.roundcube.net/trunk@4367 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 5715459a8..02efaff12 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -148,6 +148,9 @@ class rcube_imap $this->options['port'] = $port; + if ($this->options['debug']) + $this->conn->setDebug(true, array($this, 'debug_handler')); + $attempt = 0; do { $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', @@ -223,7 +226,7 @@ class rcube_imap */ function get_error_code() { - return ($this->conn) ? $this->conn->errornum : 0; + return $this->conn->errornum; } @@ -234,7 +237,7 @@ class rcube_imap */ function get_error_str() { - return ($this->conn) ? $this->conn->error : null; + return $this->conn->error; } @@ -245,9 +248,6 @@ class rcube_imap */ function get_response_code() { - if (!$this->conn) - return self::UNKNOWN; - switch ($this->conn->resultcode) { case 'NOPERM': return self::NOPERM; @@ -278,7 +278,7 @@ class rcube_imap */ function get_response_str() { - return ($this->conn) ? $this->conn->result : null; + return $this->conn->result; } @@ -546,7 +546,7 @@ class rcube_imap $imap_shared = $config->get('imap_ns_shared'); $imap_delimiter = $config->get('imap_delimiter'); - if (!$this->conn) + if (!$this->conn->connected()) return; $ns = $this->conn->getNamespace(); @@ -4740,6 +4740,16 @@ class rcube_imap return $result; } + + /** + * This is our own debug handler for the IMAP connection + * @access public + */ + public function debug_handler(&$imap, $message) + { + write_log('imap', $message); + } + } // end class rcube_imap |
