Example #1
0
 /**
  */
 protected function _connect($host, $port, $timeout, $secure, $retries = 0)
 {
     if ($retries || !$this->_params['debug']->debug) {
         $timer = null;
     } else {
         $url = new Horde_Imap_Client_Url();
         $url->hostspec = $host;
         $url->port = $port;
         $url->protocol = $this->_protocol;
         $this->_params['debug']->info(sprintf('Connection to: %s', strval($url)));
         $timer = new Horde_Support_Timer();
         $timer->push();
     }
     parent::_connect($host, $port, $timeout, $secure, $retries);
     if ($timer) {
         $this->_params['debug']->info(sprintf('Server connection took %s seconds.', round($timer->pop(), 4)));
     }
 }
Example #2
0
File: Base.php Project: horde/horde
 /**
  */
 protected function _connect($host, $port, $timeout, $secure, $context, $retries = 0)
 {
     if ($retries || !$this->_params['debug']->debug) {
         $timer = null;
     } else {
         $url = $this->_protocol == 'imap' ? new Horde_Imap_Client_Url_Imap() : new Horde_Imap_Client_Url_Pop3();
         $url->host = $host;
         $url->port = $port;
         $this->_params['debug']->info(sprintf('Connection to: %s', strval($url)));
         $timer = new Horde_Support_Timer();
         $timer->push();
     }
     try {
         parent::_connect($host, $port, $timeout, $secure, $context, $retries);
     } catch (Horde\Socket\Client\Exception $e) {
         $this->_params['debug']->info(sprintf('Connection failed: %s', $e->getMessage()));
         throw $e;
     }
     if ($timer) {
         $this->_params['debug']->info(sprintf('Server connection took %s seconds.', round($timer->pop(), 4)));
     }
 }