Loading classes without "executing" them?
Posted: Wed Mar 28, 2007 12:02 pm
Does anyone know of a way to trick the PHP engine into loading classes into memory without executing them, or at least if there are error, without it effecting the running script?
It may seem like an odd question, but I'm putting together a simple ref doc generator for a project (phpDoc and Doxygen are both good, but neither has exactly what we need), and if I could use Reflection, it would make documenting classes a lot easier. Otherwise I'll have to use tokens, which could get pretty ugly trying to pick out the right pieces.
And the reason I want to be able to load classes without errors stopping the script is so that a class can still be documented even if some dependency is missing. And trying to automatically resolve dependencies would get rather ugly as well.
You used to be able to trick the engine into doing this with php_check_syntax() in the early PHP 5 days, but it was removed in 5.0.5.
Anyone know of a way to trick the engine into loading classes into memory without effecting the running script that still works in PHP 5.1 and 5.2 ?
It may seem like an odd question, but I'm putting together a simple ref doc generator for a project (phpDoc and Doxygen are both good, but neither has exactly what we need), and if I could use Reflection, it would make documenting classes a lot easier. Otherwise I'll have to use tokens, which could get pretty ugly trying to pick out the right pieces.
And the reason I want to be able to load classes without errors stopping the script is so that a class can still be documented even if some dependency is missing. And trying to automatically resolve dependencies would get rather ugly as well.
You used to be able to trick the engine into doing this with php_check_syntax() in the early PHP 5 days, but it was removed in 5.0.5.
Anyone know of a way to trick the engine into loading classes into memory without effecting the running script that still works in PHP 5.1 and 5.2 ?