__autoload and exception friendship issue

BruceJonza

New Member
Well, I'm developing a framework and I'm working with \[code\]__autoload\[/code\] classes and \[code\]exception\[/code\]. The problem is that on PHP 5.2 you can't catch exceptions inside __autoload. I need catch them, there are some way to do it? PHP 5.3 it works fine!On my framework, you have a folder that contains some classes, but the user can try load some class that not exists. The correct way is test if \[code\]class_exists\[/code\], but I wan't make it optional, if user want work with exceptions. For instance:\[code\]$obj = new NotFoundClass();\[/code\]In this example, if debug mode of framework is on, the client will be launched to an error page, explain about this problem (the class NotFoundClass is not found in class dir). Then only if user don't catch manually this problem, I'll launch to a internal error page, that tell client about this uncatched problem.My current code is that, you can check full code on my github page or directly in the problematic file for better understanding. I don't know if I'm clear here, please talk to me in this case.
 
Top