Determining Calling Script Information

Determining Calling Script Information

am 13.08.2009 16:48:27 von Matt Giddings

--------------070306060707010204060609
Content-Type: multipart/alternative;
boundary="------------090407040804080301060001"


--------------090407040804080301060001
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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


--------------090407040804080301060001
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit








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

style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> class="Apple-style-span"
style="border-collapse: collapse; font-family: arial; font-size: 13px;">





--------------090407040804080301060001--


--------------070306060707010204060609
Content-Type: text/plain; charset=us-ascii

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

Re: Determining Calling Script Information

am 13.08.2009 16:53:15 von 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 whic=
h
> file & line called a function/method?  I would like to add some debu=
gging
> information to a method but I don't want to have to go through to each li=
ne
> 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

Re: Determining Calling Script Information

am 13.08.2009 16:55:47 von 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: Determining Calling Script Information

am 13.08.2009 17:10:32 von Matt Giddings

--------------030606040802030309050604
Content-Type: multipart/alternative;
boundary="------------040006080904080409060704"


--------------040006080904080409060704
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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

--------------040006080904080409060704
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit




http-equiv="Content-Type">


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.



--



style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> class="Apple-style-span"
style="border-collapse: collapse; font-family: arial; font-size: 13px;">


style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> class="Apple-style-span"
style="border-collapse: collapse; font-family: arial; font-size: 13px;">Matt
Giddings

Web Programmer

Information Technology Services

Saginaw Valley State University

Phone: 989.964.7247




--------------040006080904080409060704--


--------------030606040802030309050604
Content-Type: text/plain; charset=us-ascii

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