Re: PEAR2 standards: anything good at all?
| From: | Philippe Jausions | Date: | Mon, 16 Jul 2007 15:31:32 +0000 |
| Subject: | Re: PEAR2 standards: anything good at all? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47529@lists.php.net to get a copy of this message | ||
Lukas Kahwe Smith wrote:
> till wrote:
>
>> All in all, I think this discussion is really healthy as it drives
>> things forward and makes people think. So thanks again for all the
>> benchmarks and opinions here.
>
> Parts of it were healthy, but I think we have effectively managed to
> create one of the largest threads out of something I personally find a
> no brainer. I try hard to be objective here, but I find the bulk of the
> commentary to be surprisingly reactionary. Its like the only thing that
> sucks worse than the past is the future and today its raining too. Maybe
> its time to move to Pluto.
>
> regards,
> Lukas
Ok, let's assume, we get rid of all *_once calls in all PEAR2 packages,
and force a user to go with either allfiles.php (for opcode cache
environment only IMO) or an implementation (user-provided or
PEAR-provided) of an autoload function.
Given the above, how do we implement factory() methods in PEAR2
packages, especially in the cases of fallback drivers and/or optional
dependencies?
A lot of factory() methods currently test existence of classes in some
way or another, and return PEAR_Error instances in case of failure. In
other terms, would we forbid to pass FALSE to class_exists() in such
factory() methods?
Obviously, if we try to load a class that doesn't exists a fatal error
will occur, which may not be a desirable behavior, specially for a
factory() method.
Submit sample code please :-)
-Philippe