Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reflection API for a file.

Status
Not open for further replies.

thenewa2x

Programmer
Dec 10, 2002
349
US
Is there a way to use the reflection API without actually loading the class? Let's say I wanted to check the file's class. How would I go about doing this without actually "require()"ing a class? I do not want to include the class in any of the running scripts.

---------------------------------------
TINSTAAFL, which is why I contribute.
 
The class file must be included. If you don't want explicit include() or require() statements in your scripts, you might try playing around with the php.ini runtime configuration directive auto_prepend_file (link).

However, doing something like this degrades readability and thus maintainability. I strongly recommend that you explicitly use include() or require() -- six months from now when you look back at the code, you'll nearly certainly be glad you did.



Want the best answers? Ask the best questions! TANSTAAFL!
 
ok thx.

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top