RE: [PHP] Determining where a function is called from..
| From: | Jaap van Ganswijk | Date: | Fri, 15 Aug 2003 14:51:03 +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-159701@lists.php.net to get a copy of this message | ||
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