Development  »  Libraries  »  Imap_Client

Upgrading Horde_Imap_Client

Contact: dev@lists.horde.org

This lists the API changes between releases of the package.

1   Upgrading to 2.6.0

  • Horde_Imap_Client_Ids

    The split() method was added.

2   Upgrading to 2.6.0

  • Horde_Imap_Client_Fetch_Results

    The clear() method was added.

3   Upgrading to 2.5.0

  • Horde_Imap_Client_Base

    The 'exists' option was added to fetch().

4   Upgrading to 2.4.0

  • Horde_Imap_Client_Base

    The following 'sort' criteria have been added to search():

    • SORT_DISPLAYFROM_FALLBACK
    • SORT_DISPLAYTO_FALLBACK

5   Upgrading to 2.3.0

  • Horde_Imap_Client_String

    The following methods have been added:

    • getStream()

6   Upgrading to 2.2.0

  • Horde_Imap_Client_Base

    The following methods have been added:

    • getSyncToken()
    • sync()

    The following methods have been marked as deprecated and will be removed in 3.0:

    • getCacheId()
    • parseCacheId()

7   Upgrading to 2.1.0

The Horde_Imap_Client_Ids_Map class has been added.

  • Horde_Imap_Client_Cache

    The following config options have changed:

    • debug

      Now requires a Horde_Imap_Client_Base_Debug object. The previous 'true' value will be ignored.

8   Upgrading to 2.0.0

The cclient drivers have been removed.

Exception logging has been removed; the calling code is now responsible for logging any errors.

  • Horde_Imap_Client

    • factory()

      The factory method has been removed. The client driver should instead be directly instantiated.

  • Horde_Imap_Client_Base

    The following config options have been removed:

    • statuscache

    The following properties have changed:

    • $cache

      This public member variable has been removed. Obtain the cache object by calling getCache() instead.

    • $utils

      This public member variable has been removed.

    The following methods have changed:

    • append()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • copy()

      The $source and $dest parameters can no longer be UTF7-IMAP strings.

    • createMailbox()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • currentMailbox()

      The 'mailbox' portion of the return value is always returned as a Horde_Imap_Client_Mailbox object. The $options parameter has been removed.

    • deleteACL()

      This method has been added.

    • deleteMailbox()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • expunge()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • fetch()

      The 'fetch_res' option has been removed. The 'vanished' option has been removed - use the vanished() method instead. The $mailbox parameter can no longer be a UTF7-IMAP string. Results are now returned as a Horde_Imap_Client_Fetch_Results object.

    • fetchCacheIgnore()

      This method has been removed. Use getParam()/setParam() to change parameter values instead.

    • fetchFromSectionString()

      This method has been removed.

    • getNamespaces()

      The array keys, 'name' key, and 'translation' key in the return array return UTF-8 strings (not UTF7-IMAP).

    • getACL()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • getCacheId()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • getMetadata()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • getMyACLRights()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • getQuota()

      The $root parameter can no longer be a UTF7-IMAP string.

    • getQuotaRoot()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • listACLRights()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • listMailboxes()

      The return array keys are in UTF-8 (not UTF7-IMAP). The 'mailbox' return value is returned as a Horde_Imap_Client_Mailbox object. The 'utf8' parameter has been removed. The 'pattern' parameter now handles Horde_Imap_Client_Mailbox objects differently than string patterns.

    • openMailbox()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • parseCommandArray()

      This method has been removed.

    • renameMailbox()

      The $old and $new parameters can no longer be UTF7-IMAP strings.

    • search()

      The $mailbox parameter can no longer be a UTF7-IMAP string. The following constants for use with 'results' have been deprecated (use SEARCH_RESULTS_* constants instead):

      • SORT_RESULTS_COUNT
      • SORT_RESULTS_MATCH
      • SORT_RESULTS_MAX
      • SORT_RESULTS_MIN
      • SORT_RESULTS_SAVE
    • setACL()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

      The $options['remove'] parameter has been replaced by a more flexible $options['action'] parameter. To delete all ACLs for an identifier use the new deleteACL() method.

    • setQuota()

      The $root parameter can no longer be a UTF7-IMAP string.

    • status()

      The $mailbox parameter can no longer be a UTF7-IMAP string. The STATUS_LASTMODSEQ and STATUS_LASTMODSEQUIDS return options have been removed.

    • statusMultiple()

      The return array keys are in UTF-8 (not UTF7-IMAP). The $mailboxes parameter can no longer contain UTF7-IMAP strings.

    • store()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • subscribeMailbox()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

    • thread()

      The $mailbox parameter can no longer be a UTF7-IMAP string.

  • Horde_Imap_Client_Cache

    Removed the singleton() method. The 'hostspec', 'port', and 'username' parameters to the constructor have been removed.

  • Horde_Imap_Client_Data_Envelope

    Address entries are now returned as a Horde_Mail_Rfc822_List object.

    The following properties have been removed:
    • bcc_decoded
    • bcc_group
    • cc_decoded
    • cc_group
    • from_decoded
    • reply_to_decoded
    • sender_decoded
    • subject_decoded
    • to_decoded
    • to_group
  • Horde_Imap_Client_Data_Thread

    • Constructor

      The format of the first parameter ($data) has changed.

    • getRawData()

      This method has been removed.

    • getThread()

      This method now returns a list of objects. This is now the way that individual indices of a thread are accessed.

    • getThreadBase()

      This method has been removed (see getThread() for replacement).

    • getThreadIndent()

      This method has been removed (see getThread() for replacement).

    • getType()

      This method has been added.

    • lastInLevel()

      This method has been removed (see getThread() for replacement).

    • messageList()

      This method now returns the list of IDs in a Horde_Imap_Client_Ids object.

  • Horde_Imap_Client_Exception

    These constants have been removed:
    • DRIVER_NOT_FOUND
    • POP3_NOT_SUPPORTED
    • NOSUPPORTIMAPEXT
    • CATENATE_BADURL
    • BADSEARCH
  • Horde_Imap_Client_Exception_NoSupportExtension

    The $extension property has been added.

  • Horde_Imap_Client_Mailbox

    get() no longer supports the null argument to the $utf7imap parameter.

  • Horde_Imap_Client_Search_Query

    The $queries argument to andSearch() and orSearch() can be a base query in addition to an array of queries.

    The second argument to charset() has been changed to a boolean indicating whether the current text queries should be converted to the new charset provided.

  • Horde_Imap_Client_Sort

    This class has been removed. Mailbox sorting can now be accomplished with the Horde_Imap_Client_Mailbox_List class.

  • Horde_Imap_Client_Utf7imap

    The default argument for the $force parameter to Utf8ToUtf7Imap() has changed to boolean true.

  • Horde_Imap_Client_Utils

    This class has been removed. Information on the previous methods (and their replacements, if any) can be found below.

    • createUrl()

      This method has been removed. URL creation can now be accomplished with the Horde_Imap_Client_Url object.

    • escape()

      This method has been removed. String escaping can now be accomplished via the Horde_Imap_Client_Data_Format_* objects.

    • fromSequenceString()

      This method has been removed. Sequence string parsing is now natively supported within the Horde_Imap_Client_Ids object.

    • getBaseSubject()

      This method has been removed. Bsae subject determination is now handled by the Horde_Imap_Client_Utils_BaseSubject class.

    • parseCommandArray()

      This method has been removed.

    • parseUrl()

      This method has been removed. URL parsing can now be accomplished with the Horde_Imap_Client_Url object.

    • removeBareNewlines()

      This method has been removed.

    • stripNonAtomChars()

      This method has been removed. The same functionality can now be accomplished by using the stripNonAtomCharacters() method of the Horde_Imap_Client_Data_Format_Atom object.

    • toSequenceString()

      This method has been removed. Sequence string generation is now natively supported within the Horde_Imap_Client_Ids object.

  • Horde_Imap_Client_Utils_Pop3

    This class has been removed.

9   Upgrading To 1.5.0

The following properties have been added to the Horde_Imap_Client_Data_Envelope object:

  • bcc_group
  • cc_group
  • to_group

Address properties (array return values) returned from Horde_Imap_Client_Data_Envelope are now Horde_Mail_Rfc822_Address objects. These objects behave identical to the arrays that were returned previously.

The following methods have been added:

  • Horde_Imap_Client_Base#setParam()

10   Upgrading To 1.4.0

Several exception codes have been deprecated:

  • DRIVER_NOT_FOUND
  • CATENATE_BADURL
  • BADSEARCH

These are coding errors, not run-time errors, so SPL Exceptions are thrown instead of Horde_Imap_Client_Exceptions with these codes.

These exception codes have also been deprecated:

  • NOSUPPORTIMAPEXT
  • POP3_NOTSUPPORTED

Instead, a Horde_Imap_Client_Exception_NoSupportExtension will be thrown. This class is an extension of Horde_Imap_Client_Exception, so current try/catch statements will automatically catch these exceptions.

Horde_Imap_Client_Exception messages are now translated. Additionally, debug information from the server MAY be available in the 'details' property of the Exception object rather than being added to the error message.

11   Upgrading To 1.3.0

The Cclient drivers have been removed; they are instead mapped to the appropriate Socket drivers. No code needs to be changed for now as this will happen automatically. However, the 'Cclient' and 'Cclient_Pop3' driver names are deprecated and will be removed in 2.0.0.

12   Upgrading To 1.2.0

There has been a major change in the way mailbox names are handled in this version. Due to ambiguities with auto-detecting UTF-8 vs. UTF7-IMAP, all mailbox method parameters and return values are now Horde_Imap_Client_Mailbox objects. These objects, when cast to a string, will return the UTF-8 version of the mailbox.

All other non-mailbox strings that previously could be passed in as either UTF7-IMAP or UTF-8 are now REQUIRED to be passed in as UTF-8.

Auto-detection will still work, but is deprecated, will be removed in 2.0.0, and is not guaranteed to produce proper results for all mailbox names.

12.1   Changed Return Values

The following return values have changed:

  • Horde_Imap_Client_Base#currentMailbox()

    If the 'utf8' parameter is true, a Horde_Imap_Client_Mailbox object will be returned (an equivalent string representation to the previous behavior of returning a UTF-8 string).

  • Horde_Imap_Client_Base#getNamespaces()

    The return array keys and the 'name' parameter are returned in UTF7-IMAP (the documentation was previously unclear as to the charset of these items).

  • Horde_Imap_Client_Base#listMailboxes()

    If both the 'flat' and 'utf8' parameters are true, the array values will be Horde_Imap_Client_Mailbox objects, instead of a string (an equivalent string representation to the previous behavior of returning a UTF-8 string).

    If the 'flat' parameter is false and the 'utf8' parameter is true, the 'mailbox' array key will be a Horde_Imap_Client_Mailbox object instead of a string (an equivalent string representation to the previous behavior of returning a UTF-8 string).

  • Horde_Imap_Client_Base#statusMultiple()

    The return array keys are returned in UTF7-IMAP (the documentation was previously unclear as to the charset of these keys).

12.2   Deprecated Methods

The following methods are deprecated and will be removed in 2.0.0:

  • Horde_Imap_Client_Cache::singleton()

    Use Horde_Imap_Client_Cache::factory() instead.

  • Horde_Imap_Client_Base#parseCommandArray()

    Use Horde_Imap_Client_Utils#parseCommandArray() instead.

12.3   Deprecated Parameters

  • Horde_Imap_Client_Base#currentMailbox()

    The 'utf8' parameter has been deprecated. The 'mailbox' return value will exclusively return a Horde_Imap_Client_Mailbox object in 2.0.0.

12.4   Drivers

The unmaintained Mock driver has been removed.

12.5   Method Parameter Changes

  • Horde_Imap_Client_Base#append()

  • Horde_Imap_Client_Base#copy()

  • Horde_Imap_Client_Base#createMailbox()

  • Horde_Imap_Client_Base#deleteMailbox()

  • Horde_Imap_Client_Base#expunge()

  • Horde_Imap_Client_Base#fetch()

  • Horde_Imap_Client_Base#fetchFromSectionString()

  • Horde_Imap_Client_Base#getACL()

  • Horde_Imap_Client_Base#getCacheId()

  • Horde_Imap_Client_Base#getMetadata()

  • Horde_Imap_Client_Base#getMyACLRights()

  • Horde_Imap_Client_Base#getQuota()

  • Horde_Imap_Client_Base#getQuotaRoot()

  • Horde_Imap_Client_Base#listACLRights()

  • Horde_Imap_Client_Base#openMailbox()

  • Horde_Imap_Client_Base#renameMailbox()

  • Horde_Imap_Client_Base#search()

  • Horde_Imap_Client_Base#setACL()

  • Horde_Imap_Client_Base#setMetadata()

  • Horde_Imap_Client_Base#setQuota()

  • Horde_Imap_Client_Base#status()

  • Horde_Imap_Client_Base#statusMultiple()

  • Horde_Imap_Client_Base#store()

  • Horde_Imap_Client_Base#subscribeMailbox()

  • Horde_Imap_Client_Base#thread()

    These methods now require the mailbox parameter(s) to be passed in as either a Horde_Imap_Client_Mailbox object (RECOMMENDED) or a UTF-8 string. Passing in a UTF7-IMAP string is DEPRECATED and will be removed in 2.0.0. (The limitation of allowing UTF7-IMAP strings to be continued to be passed in for now is that auto-detection remains necessary. Passing in UTF-8 strings will thus break for certain mailbox names - the only way to guarantee proper mailbox handling for 1.2.0+ is to pass in Mailbox objects.)

  • Horde_Imap_Client_Base#getMetadata()

    The $entries parameter now requires the entries to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the entries as Horde_Imap_Client_Mailbox objects.

  • Horde_Imap_Client_Base#getNamespaces()

    The $additional parameter now requires the namespaces to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the namespace names as Horde_Imap_Client_Mailbox objects.

  • Horde_Imap_Client_Base#listMailboxes()

    The $pattern parameter now requires the patterns to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the patterns as Horde_Imap_Client_Mailbox objects.

    The 'utf8' parameter has been removed.

  • Horde_Imap_Client_Base#listACLRights()

  • Horde_Imap_Client_Base#setACL()

    The $identifier parameter now requires the identifiers to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 1.3. To ensure proper mailbox handling in 1.2.0+, you can pass the identifiers as Horde_Imap_Client_Mailbox objects.

  • Horde_Imap_Client_Cache#__construct()

    A new required parameter 'baseob' has been added. This replaces the 'hostspec', 'port', and 'username' parameters, which are deprecated and will be removed in 2.0.0.

    The 'debug' parameter is now a boolean indicating whether debugging is desired; debug output is now controlled via the Base object passed in through 'baseob'. The old usage - passing in a resource - is IMMEDIATELY deprecated and will be ignored.

  • Horde_Imap_Client_Utf7imap::Utf8ToUtf7Imap()

    Added the $force parameter.

12.6   New Methods

  • Horde_Imap_Client_Base#getIdsOb()
  • Horde_Imap_Client_Base#writeDebug()

12.7   New Objects

  • Horde_Imap_Client_Ids
  • Horde_Imap_Client_Ids_Pop3
  • Horde_Imap_Client_Mailbox
  • Horde_Imap_Client_Utils_Pop3

13   Upgrading To 1.1.0

13.1   New Object Properties

  • Horde_Imap_Client_Data_Envelope

    Added properties to obtain MIME decoded envelope information. New properties: 'bcc_decoded', 'cc_decoded', 'from_decoded', 'reply_to_decoded', 'sender_decoded', 'subject_decoded', 'to_decoded'