[PHP] Is it possible to get the name of the top most calling script?

2007-06-09 Thread barophobia

Hello,

I know that __FILE__ and __LINE__ report on the file and line that
they occur in. What I want is to be able to get the file name and line
of the calling script. The only way I can do this so far is by passing
the values through function arguments.

Is there any way around this?




Thanks,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is it possible to get the name of the top most calling script?

2007-06-09 Thread Tijnema

On 6/10/07, barophobia [EMAIL PROTECTED] wrote:

Hello,

I know that __FILE__ and __LINE__ report on the file and line that
they occur in. What I want is to be able to get the file name and line
of the calling script. The only way I can do this so far is by passing
the values through function arguments.

Is there any way around this?

Thanks,
Chris.


You could also use the the suberglobal $GLOBALS

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is it possible to get the name of the top most calling script?

2007-06-09 Thread Richard Lynch
On Sat, June 9, 2007 7:18 pm, barophobia wrote:
 I know that __FILE__ and __LINE__ report on the file and line that
 they occur in. What I want is to be able to get the file name and line
 of the calling script. The only way I can do this so far is by passing
 the values through function arguments.

 Is there any way around this?

If you want the main file, var_dump($_SERVER);

If you want the whole backtrace, search php.net for backtrace function.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php