RE: [PHP] Determining where a function is called from..
| From: | Wouter van Vliet | Date: | Fri, 15 Aug 2003 15:44:47 +0000 |
| Subject: | RE: [PHP] Determining where a function is called from.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159707@lists.php.net to get a copy of this message | ||
Nope .. I hadn't studiet the ref.errorfunc.php in this search.. I did some
other time and the backtrace function didn't stick around in my head.
Thank you all for helping me .. of course, debug_backtrace() was what I
needed ;) .. what a magnificent new function in PHP4.3 that is.. Only too
bad my vim syntax file doesn't yet recognize it..
Wouter
-----Oorspronkelijk bericht-----
Van: Jaap van Ganswijk [mailto:ganswijk@xs4all.nl]
Verzonden: vrijdag 15 augustus 2003 16:51
Aan: php-general@lists.php.net
Onderwerp: RE: [PHP] Determining where a function is called from..
At 2003-08-15 16:35 +0200, Wouter van Vliet wrote:
>I noticed the __LINE__ and __FUNCTION__ magic constants too, but they don't
>really contain the values I was looking for, as they have the current
>function and line in it. But what I want my Logging class (I have one too
>:D) to display is what I am about to illustrate with an example:
>
>script: index.php
>-----------------
> 01 $Database->connect('host', 'database',
> 'username',
'password');
> (...)
> 20 $Database->execute('DELETE news WHERE id IN ()');
>
> -> this would produce an error in my Database class, error in sql
syntax
>
>...etc.
Have you studied this:
http://www.php.net/manual/en/function.debug-backtrace.php
You may also want to invoke phpinfo() at the place the
error is occuring.
There are more nice functions on:
http://www.php.net/manual/en/ref.errorfunc.php
Greetings,
Jaap
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php