Uploaded image for project: 'Zeta Components'
  1. Zeta Components
  2. ZETACOMP-32

Inconsistent parameter types and little problems in ezcMailImapTransport

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Mail
    • None

    Description

      In ezcMailImapTransport (I don't know if the same applies to other classes) the message id parameters are sometimes arrays, sometimes strings and sometimes int. Sometimes they are called $messages, sometimes $msgNum, sometimes $number.

      For example in copyMessages it is a string. This is flexible, as you can pass "1,3,4" or "1:3" or even "2,4:7,9,12:*".
      fetchSizes() expects an array, which is join()ed inside the method. This restricts to only comma-separated usage, something like "3:*" is not possible (besides using listmessages() to get all ids and then pass this big array). The same happens in fetchFlags() and sort().

      In delete() it is called $msgNum and has to be an int, but it is used the same way as in copyMessages(), to be flexible it should be a string. Then you don't have to call delete() 1000 times if you want to delete 1000 messages.

      Minor problems exist in fetchSizes() and fetchFlags. $messages has to be an array, so this is not working:
      throw new ezcMailTransportException( "The IMAP server could not fetch flags for the messages '{$messages}': {$response}." );
      If $messages is a string (see above) this problem will disappear.

      Attachments

        Activity

          People

            Unassigned Unassigned
            phpgangsta Michael Kliewe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: