Re: Name of file currently being processed
| From: | Adam Trachtenberg | Date: | Tue, 18 Jul 2000 04:23:15 +0000 |
| Subject: | Re: Name of file currently being processed | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24841@lists.php.net to get a copy of this message | ||
include_once()
-adam
On Mon, 17 Jul 2000, Joey Smith wrote:
> 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
> >
> >
> >
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
/ adam maccabee trachtenberg | visit college life online \
\ adam@student.net | http://www.student.com /