> I have a function in one of my includes: db.inc.php::getQuery which does
> most of my mySQL calling for me.
>
> However, when the mySQL call fails, I get a nice error which is useful
> except one thing. It doesn't tell me which function called it.
>
> Does anyone know how to find to do the equivalent of:
>
> function myFunc()
>     {
>         echo "myFunc was called by the function $calling_function";
>     }

AFAIK, the internal functions to walk the stack are not yet available in
user-land PHP.  They do exist, at some level, since the Zend IDE and others
are using them for debugging, I think.

Meanwhile, about all you can do is:

Consider passing __FILE__ and __LINE__ into your getQuery function.

Stop using a class wrapper. :-)

There may also be some fancy combination of http://php.net/assert and the
apparently undocumented (unsupported?) set_error_handler() function that
*MIGHT* allow the reporting of the true function call line and script, but
my gut says "No".

You may want to investigate using an IDE which does provide facilities that
are an alternative.  http://zend.com and Active State's Komodo are two
options.  There are many, many, many more, and we don't really need another
thread on them all, do we?...  Go find that UK guy's site that lists all PHP
Editors with relative merits.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to