Req #54032 [Com]: ability to to handle Class not found error
| From: | tyra3l at gmail dot com | Date: | Wed, 16 Feb 2011 23:15:36 +0000 |
| Subject: | Req #54032 [Com]: ability to to handle Class not found error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158816@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54032&edit=1
ID: 54032
Comment by: tyra3l at gmail dot com
Reported by: tyra3l at gmail dot com
Summary: ability to to handle Class not found error
Status: Open
Type: Feature/Change Request
Package: SPL related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
*exists -> exit
*exection -> execution
* spl autoload callbacks was executed -> spl autoload callbacks was
executed
without finding the class
* I cannot continue the normal execution flow -> I couldn't continue the
normal
execution flow
* from a higher level -> at a higher level
sorry, its getting late, and my english skill degrades with sleep
deprivation
Previous Comments:
------------------------------------------------------------------------
[2011-02-17 00:11:01] tyra3l at gmail dot com
Description:
------------
currently you can throw an exception from the autoloader, hence if you
can't
find a class, your application can gracefully exists, instead of exiting
via the
class not found fatal error.
my problem is, that I would like to use multiple autoloader (for example
in a
project which uses multiple component, or framework), but in this case,
I can't
throw an Exception from my autoloader, because maybe the other
autoloaders could
load the class.
if I'm sure that I will register the last autoloader, the this isn't a
problem(my last autoloader will throw the Exception on missing class),
but maybe
I have to load a component late of the exection.
it would be cool, if I could somehow register a callback which will be
called,
when the spl autoload callbacks was executed, but the class couldn't be
loaded
of course, from this callback, I cannot continue the normal execution
flow,
however I can log the error, and let the callback return and get the
class not
found fatal error, or throw an Exception, and handle/log the error from
a higher
level.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54032&edit=1