> I don't have access to the PHP CVS at the moment (note to self: get a C
> compiler)... but I wanted to ask how this will affect (or will it?) HTML
> generated from within included PHP files. Eg. A is at web root and
includes
> B in a subdirectory X. B generates HTML that calls for image C.gif in
> subdirectory X. Will src = "C.gif" work or will it still be src =
"X/C.gif"
> or is this not affected at all?
>
> If it's not affected, is it possible to have an environment variable that
> contains the path to the subdirectory of the latest included file so that
it
> can be accessed from within that file to refer to itself? I believe that
> this will be very useful for templating applications.
This issue has been metioned before. HTML will definetely NOT
be changed by PHP. (PHP will, besides propagation of PHPSESSID,
never interfere with html).
Because this is not going to happen (as it is hard to implement properly,
without appearing magical), you can doubt wether it is this
useful to have a fix that only fixes half of the problem (the easiest
half, that is).
Besides, it is also, IMHO, quite untransparant what happens, and
I'm afraid this will lead to very strange bugs.
I think it would be the most logical to implement include & friends so,
that they always work relative to the file in which the include is.
However, this will definitely break current scripts, so either
this patch shouldn't be committed at all, OR should be in PHP 5,
in order to make sure we will break every possible script there
is out there ;), OR this should be configureable (also in .htaccess).
I always wonderd why it worked the way it currently works, but
when you know the implementation, you know this is a lot easier to
implement...
By the way, I seem to contradict myself here, which maybe is
the case, but anyway: including scripts (like init or something)
is something different than including images...
> Currently I've developed a templating solution that relies on regex to
> change all relative links (inc. those to images, embeded objects, etc.
etc.)
> in included files to absolute ones but this is a rather convulted way of
> doing things.
There are better ways of doing this... But maybe a genuine PHP(tm)-solution
would be even better. I have currently no ideas on what kind of solution
though :)
What I always do, is using absolute paths ('/images/image3.png'), and in
some init I define some constants that contain IMG_DIR, etc, so you can
change it in one place.
Jeroen
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]