Re: Why change require_once? A brief explanation of motives

From: Date: Wed, 18 Jul 2007 07:10:11 +0000
Subject: Re: Why change require_once? A brief explanation of motives
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47592@lists.php.net to get a copy of this message
Alan Knowles wrote:
How am I supposed to lazy load an the Exception implementation by just relying on require_once?
depending on how you use Exceptions (control flow or in exceptional situations) require_once 'MyPackage/Exception.php; throw new MyPackage_Exception_FileNotFound($thefile);
Well, I do not think that this really qualifies as a good solution.
So far the only justification that is currently not been explored for this change is "enables more flexibility" - Could you explain how it would enable that? and why that flexibility would be useful and commonly used. I can not see any amazing flexibility, only more problems.
I think I just posted some examples of how this is useful, short summary plus a few extra from the top of my head: - being able to gracefully handle missing classes - being able to shorten the include path in case for some reason you end up having a lot of entries in your include path - getting rid of stat calls (I know we need new benchmarks on the relevance of this one) - wanting to add some logging/debugging at class load time regards, Lukas

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