Re: [PHP-DEV] Environment variable solution to relative includes (will work for HTML too.)

2001-07-12 Thread Aral Balkan

>> There are better ways of doing this...  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.

I wish I could do this but I'm designing a web site creation / management
system  with the ability to pull in files from anywhere as part of its
templating engine. Your solution would work if it a site but I need the
system to be as flexible as possible.

I believe that the solution I proposed earlier: i.e., having an environment
variable (eg. $PHP_CURRENT_INCLUDE or something) contain the path to the
latest included file. That way the included page could decide how it wants
to include other files *and* the variable could be used to link to elements
(eg. images, etc.) in the same directory as the included file. Perhaps there
could even be two variables (along the lines of $PHP_CURRENT_INCLUDE_PATH
and $PHP_CURRENT_INCLUDE_URL), one the path to the include file and the
other an absolute URL (e.g. the file could be included from another server).
These two should cover anything that anyone might possibly want to do in an
included file and offer complete flexibility without having to rewrite any
functions.

Should I submit this as a feature request?

All my best,
Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯


__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Preliminary patch for allowing relative includes

2001-07-11 Thread Aral Balkan

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.

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.

(I hope any of this makes sense!)

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Possible feature for current version of PHP or PHP 4.1/5.0.

2001-07-10 Thread Aral Balkan

>> If we choose to do it in Andi's way (no real drawbacks, considering it's
downwards compatible for most practical purposes), we can do it within 4.0.

This would be even better. To echo what Andrei said, "the sooner the better"
:) I've personally been wishing for this for the longest time!

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Possible feature for current version of PHP or PHP 4.1/5.0.

2001-07-09 Thread Aral Balkan

>> Does others also think it should wait for 4.1 or later?

I for one would love to see it in 4.1 -- IMVHO This would be a very
important feature and a great improvement!

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Possible feature for current version of PHP or PHP 4.1/5.0.

2001-07-09 Thread Aral Balkan

> How about #3 for 4.1 and #2 for 5.0?

This would be wonderful!

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]