Re: Re: alternative to the fopen() hack in autoloaders
| From: | Lukas Kahwe Smith | Date: | Wed, 11 Nov 2009 09:53:12 +0000 |
| Subject: | Re: Re: alternative to the fopen() hack in autoloaders | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46023@lists.php.net to get a copy of this message | ||
On 11.11.2009, at 10:47, Richard Quadling wrote:
2009/11/11 Lukas Kahwe Smith <mls@pooteeweet.org>:Well this makes it impossible to handle the issue locally, which creates all sorts of issues when you just want to drop in a frameworks autoloader. It also means that you now globally handle such failures, where you do not know if in case the file is missing there will be additional logic locally to handle the failure. Furthermore unless you use track errors you would not be able to determine if the load failed because of a missing file or a syntax error. regards, Lukas Kahwe Smith mls@pooteeweet.org[snip]Would using a userland-based set_error_handler() be of use here? If, under normal circumstances, blind include() is what is used, then trapping the error when it fails would be when you could test for whatever it is you want to test for?