Are you saying that it's better not to use relative paths on include(...)'s,
require(...)'s and their (x)_once(...) cousins?

That seems awkward to me.

Why would I want to hard code a path, even if I was including additional
functionality from another file?



> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 10, 2004 1:50 PM
> To: Samuel Ventura; [EMAIL PROTECTED]
> Subject: Re: [PHP] HELP: Nested include(...)'s take relative paths not
> intuitively
> 
> From: "Samuel Ventura" <[EMAIL PROTECTED]>
> 
> > I have 3 files in nested subdirectories
> >
> > (1) /test.php
> > (2) /subdir1/test.php
> > (3) /subdir1/subdir2/test.php
> >
> > if I call (3) it loops forever in (2) trying to
> > including itself.
> >
> > Is this a bug or a feature?
> 
> A feature?
> 
> You make a request for (3). The thing to remember/realize is that now all
> require(), include(), etc. calls now happen relative to the path of (3).
> So,
> when you include (2), which tries to include ../test.php, it is trying to
> include itself again because the include() happens relative to the path of
> (3).
> 
> include()'s are almost like a cut and paste. If you took the code from (2)
> and pasted it into (3) in place of the include(), that's the end result.
> 
> This is why I do not use relative paths.
> 
> ---John Holmes...
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


****************************************************************** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
****************************************************************** 


Reply via email to