Re: [PHP] Determining Calling Script Information

2009-08-13 Thread Matt Giddings

Thanks for the pointers!

Matt

Robert Cummings wrote:

Matt Giddings wrote:

Hi,

Is there a way (other than using __LINE__ and __FILE__) to determine 
which file & line called a function/method?  I would like to add some 
debugging information to a method but I don't want to have to go 
through to each line that calls it and add the __LINE__ and __FILE__ 
parameters.  Guess I'm looking for a simple solution.  Anyway, if 
there is a way just point me in the right direction and I'll take it 
from there. 


See the help for debug_backtrace()

Cheers,
Rob. 


--

Matt Giddings
Web Programmer
Information Technology Services
Saginaw Valley State University
Phone: 989.964.7247
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Determining Calling Script Information

2009-08-13 Thread Robert Cummings

Matt Giddings wrote:

Hi,

Is there a way (other than using __LINE__ and __FILE__) to determine 
which file & line called a function/method?  I would like to add some 
debugging information to a method but I don't want to have to go through 
to each line that calls it and add the __LINE__ and __FILE__ 
parameters.  Guess I'm looking for a simple solution.  Anyway, if there 
is a way just point me in the right direction and I'll take it from there.


See the help for debug_backtrace()

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Determining Calling Script Information

2009-08-13 Thread Andrew Ballard
On Thu, Aug 13, 2009 at 10:48 AM, Matt Giddings wrote:
> Hi,
>
> Is there a way (other than using __LINE__ and __FILE__) to determine which
> file & line called a function/method?  I would like to add some debugging
> information to a method but I don't want to have to go through to each line
> that calls it and add the __LINE__ and __FILE__ parameters.  Guess I'm
> looking for a simple solution.  Anyway, if there is a way just point me in
> the right direction and I'll take it from there.
>
> Thanks,
> Matt
>

You can use debug_backtrace() inside the function.

Andrew

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



[PHP] Determining Calling Script Information

2009-08-13 Thread Matt Giddings

Hi,

Is there a way (other than using __LINE__ and __FILE__) to determine 
which file & line called a function/method?  I would like to add some 
debugging information to a method but I don't want to have to go through 
to each line that calls it and add the __LINE__ and __FILE__ 
parameters.  Guess I'm looking for a simple solution.  Anyway, if there 
is a way just point me in the right direction and I'll take it from there.


Thanks,
Matt

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