Re: CGI/1.1 draft

Baard.Haafjeld@nta.no
Tue, 1 Mar 1994 13:52:50 --100


I would like to suggest (re)introduction of two environment variables
that I miss when I'm writing CGI scripts. I'm sorry if I reintroduce
matters already discussed, I have not been reading www-talk regularily
up to now.

These suggested variables basically aims at avoid hardcoding directory
configuration information into the scripts themselves, thus making them
a lot more portable.

SCRIPT_DATA_DIR: I keep missing some preconfigured place a script can go
look for configuration data, search indices, write logs etc.
Currently my
scripts tend to start with 'data_dir=/some/where' etc. It would
be a lot more portable if the servers could provide one common
configured directory for such stuff, so I could say
'data_dir=$SCRIPT_DATA_DIR/myscriptname/...'

DOCUMENT_ROOT: I miss the DOCUMENT_ROOT environment variable that is
available to NCSA http /htbin scripts. I realize you have
probably discussed this and it was removed as 'too http'ish' :)
However I have scripts where I KNOW I'm operating in http
environment and want to update html documents etc from my
scripts. I then need to know where the http server's tree
starts. My current trick is extracting this from PATH_INFO and
PATH_TRANSLATED, but this does not work if there is no
path-info(at least not with NCSA http). So I'm back to
hardcoding paths in the top if my scrips. Bad, bad.
Even if this variable may not make sense for gopher etc, I still
think it should be present for those scripts who KNOW they are
in a http environment.. which at the moment are most of them?

|
Baard Haafjeld | When you give a wolf a poodle cut, you
Norwegian Telecom Research | don't get a show dog but a pissed wolf.
SMTP-mail: Baard.Haafjeld@tf.tele.no | -Robert Asprin