Re: Re: Maildir Class
| From: | Ian Eure | Date: | Mon, 02 Aug 2004 23:03:23 +0000 |
| Subject: | Re: Re: Maildir Class | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32380@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 02 August 2004 03:04 pm, Andrew Boothman wrote:
> I'm having a bit of a problem with that - apparently I can't return
> anything but a new Mail_Maildir object from the object's constructor,
> meaning that I can't return a PEAR_Error object if the directory can't
> be opened or whatever.
>
> For the moment I'm using an open() method to do the work instead, do you
> have any suggestions for how to deal with this correctly? I understand
> there is some new work going on reguarding error handling in PEAR, and
> even that PHP5 includes some better error-handling but I'm not sure how
> to deal with it using the present infrastructure.
>
Use a factory method, so you create a new instance with
$md = &Mail_Maildir::factory('/path/to/maildir');
You might also want to provide a singleton pattern.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBDshAxuUdPD6j2IMRAg4dAJ9qpZdi2jn15+mSDY8NRakWsbfKegCeISRg
4xl58tt2dZwkjaBICvFJWJc=
=bFd9
-----END PGP SIGNATURE-----