I have written this code 5-6 years ago, there is definitely room for improvement :)
you should probably get rid of the evals as soon as possible. there are other ways to test for a class and method (is_readable(), class_exists(), method_exists() or the reflection api which I don't remember the syntax of offhand)