NYCPHP Meetup

NYPHP.org

[nycphp-talk] Tricks with __FILE__?

Chris Bielanski Cbielanski at inta.org
Fri Jul 16 12:39:04 EDT 2004


In the interest of making my error mesages more meaningful, I've written
code where calls to functions often have __FILE__ and __LINE__ in the
argument list. I pass them in explicitly because AFAIK, that's all that can
be done. When I include or require a module, the value of __FILE__ is of
course the same as the name of the include. This is as expected. That's why
I pass those constants when I call the function contained within the
include. Pretty straightforward, but tedious.

Can anyone suggest how I might be able to gather the name of the *original*
script that's calling include()? Is there an element on $_SERVER[] that can
do the trick?



Thanks,
Chris Bielanski
Web Programmer, 
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org  
INTA -- 125 Years of Excellence





More information about the talk mailing list