Re: Imap Backend Propsal

From: Date: Thu, 12 Feb 2004 10:15:16 +0000
Subject: Re: Imap Backend Propsal
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25609@lists.php.net to get a copy of this message
> >Use a URI style abstraction: > > > >imap://user:pass@mail.yourhost.com:110/pop3/notls#INBOX > > > >You could even use Net_URL if you really wanted to get all the relevant > >parts. > > > >Richard Heyes > > I have given this a try as it is, but the URL doesn't work when passed to > imap_open, the server portion of the URL must be enclosed in curly braces > and the user and password arguments are passed separately. I also tried > several variations based on the specification articles that I read. Well I didn't mean pass the uri directly to imap_open(), hence the use of the word "abstraction". The user would pass you a uri such as: imap://user:pass@mail.example.com:143/INBOX And you would use Net_URL (or some other URI parsing code) to extract the parts out and pass to imap_open(). > I don't > think it would be too much work for the user to visit the imap_open docs > which shows all the possible variations for different servers. It might not be too much, but it is definitely unnecessary when easier solutions are possible. Using this (URI) method also makes it easier for whoever writes a wrapper class around all the various PEAR mail store access classes. Should that occur. > I could > pre-define each possible variation of connection methods and define > constants for the user to pass. > > Like so... Pointless imho. > Using the above the program can be set-up to default to an IMAP server on > localhost running on port 143. You can do that with any method of connection specification. > Do you think this would make it easier to specify this argument, or further > confuse things? The latter. -- Richard Heyes

« previous php.pear.dev (#25609) next »