[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/horde/framework/Horde/Imap/Client/Socket/Connection/ -> Base.php (source)

   1  <?php
   2  /**
   3   * Copyright 2014 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file COPYING for license information (LGPL). If you
   6   * did not receive this file, see http://www.horde.org/licenses/lgpl21.
   7   *
   8   * @category  Horde
   9   * @copyright 2014 Horde LLC
  10   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  11   * @package   Imap_Client
  12   */
  13  
  14  /**
  15   * Base class for stream connection to remote mail server.
  16   *
  17   * NOTE: This class is NOT intended to be accessed outside of the package.
  18   * There is NO guarantees that the API of this class will not change across
  19   * versions.
  20   *
  21   * @author    Michael Slusarz <slusarz@horde.org>
  22   * @category  Horde
  23   * @copyright 2014 Horde LLC
  24   * @internal
  25   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  26   * @package   Imap_Client
  27   */
  28  class Horde_Imap_Client_Socket_Connection_Base extends Horde\Socket\Client
  29  {
  30      /**
  31       * Protocol type.
  32       *
  33       * @var string
  34       */
  35      protected $_protocol = 'imap';
  36  
  37      /**
  38       */
  39      protected function _connect($host, $port, $timeout, $secure, $retries = 0)
  40      {
  41          if ($retries || !$this->_params['debug']->debug) {
  42              $timer = null;
  43          } else {
  44              $url = new Horde_Imap_Client_Url();
  45              $url->hostspec = $host;
  46              $url->port = $port;
  47              $url->protocol = $this->_protocol;
  48              $this->_params['debug']->info(sprintf(
  49                  'Connection to: %s',
  50                  strval($url)
  51              ));
  52  
  53              $timer = new Horde_Support_Timer();
  54              $timer->push();
  55          }
  56  
  57          parent::_connect($host, $port, $timeout, $secure, $retries);
  58  
  59          if ($timer) {
  60              $this->_params['debug']->info(sprintf(
  61                  'Server connection took %s seconds.',
  62                  round($timer->pop(), 4)
  63              ));
  64          }
  65      }
  66  
  67  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1