A little help needed - get_filename() and get_linenum()

From: Date: Wed, 04 Sep 2002 13:36:05 +0000
Subject: A little help needed - get_filename() and get_linenum()
Groups: php.dev 
Request: Send a blank email to php-dev+get-87903@lists.php.net to get a copy of this message
Hi All, Im looking at developing a couple of functions which could retrieve the current line number, and filename where ever they are put. By file name, I mean the actual file name, not the parent (eg: the file that included this one)... very similar to what would be outputted in a syntax error or such. A scenario where this would be useful would be in include files: <?php if ($_SERVER["SCRIPT_FILENAME"] == get_filename()) { die("Dont talk to me!"); // or a header redirect, you get the jist } ?> It would also be useful for custom debug functions which dump to log files. What Im after is a bit of help of where to start, any areas of PHP which I can canabalise for hints / tips on doing this, examples - or even information if this has been tried and failed / succeeded before. also - would anyone else find this sort of functionality helpful, or is it just me? Thanks for any help, -- Dan Hardiker [dhardiker@staff.firstcreative.net] ADAM Software & Systems Engineer First Creative Ltd

« previous php.dev (#87903) next »