Re: [PHP] Which file called the function?

2007-12-31 Thread Nathan Nobbe
On Dec 20, 2007 7:06 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Thu, 2007-12-20 at 19:54 +, George Pitcher wrote: > > > On Thu, December 20, 2007 8:37 am, Christoph Boget wrote: > > > > Let's say I have the following 3 files > > > > > > > > global.php > > > > > > > function myFunc(

RE: [PHP] Which file called the function?

2007-12-31 Thread Richard Lynch
On Thu, December 20, 2007 1:54 pm, George Pitcher wrote: > I have a functions file with over 400 functions (and that may be too > many - > but it works). I've been adding some error reporting in to my PEAR::DB > queries, but wanted to know which page triggered the function. I went > theough my php

RE: [PHP] Which file called the function?

2007-12-21 Thread Cesar D. Rodas
__FILE__ == "global.php" On 20/12/2007, Christoph Boget <[EMAIL PROTECTED]> wrote: > > Let's say I have the following 3 files > > global.php >function myFunc() { echo __FILE__; } > ?> > > one.php >include( 'global.php' ); > echo 'You are in file: '; > myFunc(); > ?> > > two.php >in

RE: [PHP] Which file called the function?

2007-12-20 Thread Shelley Shyan
Boget Sent: Thursday, December 20, 2007 10:37 PM To: PHP General Subject: [PHP] Which file called the function? Let's say I have the following 3 files global.php one.php two.php In each case, what is echoed out for __FILE__ is global.php. Apart from analyzing the debug_backtrace array, i

RE: [PHP] Which file called the function?

2007-12-20 Thread Robert Cummings
On Thu, 2007-12-20 at 19:54 +, George Pitcher wrote: > > On Thu, December 20, 2007 8:37 am, Christoph Boget wrote: > > > Let's say I have the following 3 files > > > > > > global.php > > > > > function myFunc() { echo __FILE__; } > > > ?> > > > > > > one.php > > > > > include( 'global.php

RE: [PHP] Which file called the function?

2007-12-20 Thread George Pitcher
> On Thu, December 20, 2007 8:37 am, Christoph Boget wrote: > > Let's say I have the following 3 files > > > > global.php > > > function myFunc() { echo __FILE__; } > > ?> > > > > one.php > > > include( 'global.php' ); > > echo 'You are in file: '; > > myFunc(); > > ?> > > > > two.php > >

Re: [PHP] Which file called the function?

2007-12-20 Thread Richard Lynch
On Thu, December 20, 2007 8:37 am, Christoph Boget wrote: > Let's say I have the following 3 files > > global.php >function myFunc() { echo __FILE__; } > ?> > > one.php >include( 'global.php' ); > echo 'You are in file: '; > myFunc(); > ?> > > two.php >include( 'global.php' ); >

Re: [PHP] Which file called the function?

2007-12-20 Thread Daniel Brown
On Dec 20, 2007 9:47 AM, Christoph Boget <[EMAIL PROTECTED]> wrote: [snip!] > I need it primarily for debugging purposes. I've got a single function > that's called by several files. And instead of modifying all the files > calling the function to add logging, it would be nice to just modify the

Re: [PHP] Which file called the function?

2007-12-20 Thread Jochem Maas
Christoph Boget schreef: >> I believe __FILE__ is resolved at compile time, not run-time which >> means what you're seeing is expected behavior. I'm not sure how you'd >> get the name of the file that a function call was made from. >> Could you explain why you need this information in your appl

Re: [PHP] Which file called the function?

2007-12-20 Thread Stut
Christoph Boget wrote: I believe __FILE__ is resolved at compile time, not run-time which means what you're seeing is expected behavior. I'm not sure how you'd get the name of the file that a function call was made from. Could you explain why you need this information in your application, an

Re: [PHP] Which file called the function?

2007-12-20 Thread Christoph Boget
> I believe __FILE__ is resolved at compile time, not run-time which > means what you're seeing is expected behavior. I'm not sure how you'd > get the name of the file that a function call was made from. > Could you explain why you need this information in your application, > and perhaps some

Re: [PHP] Which file called the function?

2007-12-20 Thread Nilesh Ashra
On 20 Dec 2007, at 14:37, Christoph Boget wrote: Let's say I have the following 3 files global.php one.php two.php In each case, what is echoed out for __FILE__ is global.php. Apart from analyzing the debug_backtrace array, is there any way that myFunc() would display "one.php" and

[PHP] Which file called the function?

2007-12-20 Thread Christoph Boget
Let's say I have the following 3 files global.php one.php two.php In each case, what is echoed out for __FILE__ is global.php. Apart from analyzing the debug_backtrace array, is there any way that myFunc() would display "one.php" and "two.php" respectively? thnx, Christoph