I'm building my own function to handle includes, that does some pre- and post- include processing. It and some other functions are being called with the auto_prepend_file option, so it's available everywhere in my site. (Actually I'm building a whole development environment ontop of PHP - http://webmages.com/devel/).
I'm running into a stumbling block, trying to tell where that function was called from. I'd like to be able to do
my_include('file.php'); and have my_include() know what file (and what line number), it was called from.
I suppose I could do something like:
my_include('file',FILE,LINE);
but I'm looking for something a little more transparent.
Perhaps I'm missing something in the documentation, but it would really help to have constants inside a function that contain the file and line number from where the function was called. I'm guessing PHP already keeps track of this internally for error handling, etc. - how difficult would it be to expose it?