__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
- cache: (array) If set, caches data from fetch(), search(), and
         thread() calls. Requires the horde/Cache package to be
         installed. The array can contain the following keys (see
         Horde_Imap_Client_Cache for default values):
  - backend: [REQUIRED (or cacheob)] (Horde_Imap_Client_Cache_Backend)
             Backend cache driver [@since 2.9.0].
  - fetch_ignore: (array) A list of mailboxes to ignore when storing
                  fetch data.
  - fields: (array) The fetch criteria to cache. If not defined, all
            cacheable data is cached. The following is a list of
            criteria that can be cached:
    - Horde_Imap_Client::FETCH_ENVELOPE
    - Horde_Imap_Client::FETCH_FLAGS
      Only if server supports CONDSTORE extension
    - Horde_Imap_Client::FETCH_HEADERS
      Only for queries that specifically request caching
    - Horde_Imap_Client::FETCH_IMAPDATE
    - Horde_Imap_Client::FETCH_SIZE
    - Horde_Imap_Client::FETCH_STRUCTURE
- capability_ignore: (array) A list of IMAP capabilites to ignore, even
                     if they are supported on the server.
                     DEFAULT: No supported capabilities are ignored.
- comparator: (string) The search comparator to use instead of the
              default server comparator. See setComparator() for
              format.
              DEFAULT: Use the server default
- context: (array) Any context parameters passed to
           stream_create_context(). @since 2.27.0
- debug: (string) If set, will output debug information to the stream
         provided. The value can be any PHP supported wrapper that can
         be opened via PHP's fopen() function.
         DEFAULT: No debug output
- hostspec: (string) The hostname or IP address of the server.
            DEFAULT: 'localhost'
- id: (array) Send ID information to the server (only if server
      supports the ID extension). An array with the keys as the fields
      to send and the values being the associated values. See RFC 2971
      [3.3] for a list of standard field values.
      DEFAULT: No info sent to server
- lang: (array) A list of languages (in priority order) to be used to
        display human readable messages.
        DEFAULT: Messages output in IMAP server default language
- password: (mixed) The user password. Either a string or a
            Horde_Imap_Client_Base_Password object [@since 2.14.0].
- port: (integer) The server port to which we will connect.
        DEFAULT: 143 (imap or imap w/TLS) or 993 (imaps)
- secure: (string) Use SSL or TLS to connect. Values:
  - false (No encryption)
  - 'ssl' (Auto-detect SSL version)
  - 'sslv2' (Force SSL version 3)
  - 'sslv3' (Force SSL version 2)
  - 'tls' (TLS; started via protocol-level negotation over
    unencrypted channel; RECOMMENDED way of initiating secure
    connection)
  - 'tlsv1' (TLS direct version 1.x connection to server) [@since
    2.16.0]
  - true (TLS if available/necessary) [@since 2.15.0]
    DEFAULT: false
- timeout: (integer)  Connection timeout, in seconds.
           DEFAULT: 30 seconds
- username: (string) [REQUIRED] The username.
Пример #1
0
 /**
  * @param array $params  A hash containing configuration parameters.
  *                       Additional parameters to base driver:
  *   - debug_literal: (boolean) If true, will output the raw text of
  *                    literal responses to the debug stream. Otherwise,
  *                    outputs a summary of the literal response.
  *   - envelope_addrs: (integer) The maximum number of address entries to
  *                     read for FETCH ENVELOPE address fields.
  *                     DEFAULT: 1000
  *   - envelope_string: (integer) The maximum length of string fields
  *                      returned by the FETCH ENVELOPE command.
  *                      DEFAULT: 2048
  *   - xoauth2_token: (mixed) If set, will authenticate via the XOAUTH2
  *                    mechanism (if available) with this token. Either a
  *                    string (since 2.13.0) or a
  *                    Horde_Imap_Client_Base_Password object (since
  *                    2.14.0).
  */
 public function __construct(array $params = array())
 {
     parent::__construct(array_merge(array('debug_literal' => false, 'envelope_addrs' => 1000, 'envelope_string' => 2048), $params));
 }
Пример #2
0
 /**
  */
 public function __construct(array $params = array())
 {
     parent::__construct($params);
     if (empty($params['port'])) {
         $this->_params['port'] = isset($this->_params['secure']) && in_array($this->_params['secure'], array('ssl', 'sslv2', 'sslv3')) ? 995 : 110;
     }
 }