Frederik Holljen wrote: > Hi, > >> Using unique IDs to refer to messages in IMAP was needed by many >> developers (as I have seen on IRC). So here it is finally! >> >> >> In IMAP a message can be accessed by its message number (which can >> change over time as messages are deleted and received) or by its unique >> ID (which usually never changes). >> >> >> To enable using IDs, create the IMAP transport object with an extra option: >> >> <code> >> $imap = new ezcMailImapTransport( 'server', null, array( >> 'uidReferencing' => true ) ); >> </code> >> >> Alternatively you can set the option via an option object: >> <code> >> $options = new ezcMailImapTransportOptions(); >> $options->uidReferencing = true; >> >> $imap = new ezcMailImapTransport( 'server' ); >> $imap->options = $options; >> </code> > > Isn't this a bit confusing having dual purpose for the same functions like > this?
How is it confusing? I think it is similar with Base::autoload() which uses the debug option to throw an exception or not. > Also, afaik it is possible to use these two access methods at the same > time no? The functions work in message number mode, or in uid mode, not both at the same time. > Is enabling it in the start a requirement (any internal referencing > done?). If not it would be possible to add an uid option to each of the > methods that may accept it like > <code> > $imap->top(, 325, true ); // second option enables uids. > </code> > > Another option is to have separate methods for uids.. but that will be messy.. > <code> > $imap->topUid( 325 ); > </code> I thought of both your ideas, but I decided to implement it with an option because it seemed easier to understand. Nobody said anything about it for 3 weeks, so it must be the perfect solution then. Having duplicate functions (top, topUid) is not good. Adding extra parameters to functions also doesn't seem right. But maybe somebody else has a better idea? -- Alexandru Stanoi eZ Components System Developer eZ Systems | http://ez.no -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
