Re: Name of file currently being processed

From: Date: Tue, 18 Jul 2000 03:21:00 +0000
Subject: Re: Name of file currently being processed
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24839@lists.php.net to get a copy of this message
Actually, I asked the wrong question...I don't really want to do this from user-space (although if the mechanism is there, it might be useful in user-space), what I am really looking to do is to protect from recursive inclusion of files: p1.php <? include "p1.php"; ?> Yes, I realize, this is a stupid error...but it seems like it might not be too hard to catch... main/main.c:497 (or so) if (filename == current_file) RETURN_FALSE; On Mon, 17 Jul 2000, Joey Smith wrote the following to PHP Developer List : > Is there any way to find out the name of the file currently being > processed? For example: > > p1.php > <?php > include "p2.php"; > ?> > > p2.php > <?php > include "p3.php"; > > print current_file(); > ?> > > p3.php > <?php > print current_file(); > ?> > > Hitting p1.php would print: > p3.php > p2.php > > >

« previous php.dev (#24839) next »