Hi
I've been googling this, but the search terms are too common and return a lot of irrelevant results. Hopefully someone has experience of something like this:
I'd like to be able to determine what apache environment variables are set for a given directory - NOT the parent directory of the running script (easily done), but any other directory.
Presumably, apache determines the environment variables (and all other options) set in .htaccess files by traversing upward, e.g. if I run a script in /var/www/clancy then apache first looks in /var, then /var/www, and finally /var/www/clancy for .htaccess files. Each is processed in this order, so that if /var/www/.htaccess looked like this:
SetEnv foo bar
and /var/www/clancy/.htaccess looked like this:
SetEnv foo baz
then running the following in /var/www/clancy/foo.php
<?php echo getenv('foo'); ?>
... yields "baz".
Now if I were writing an application that served this purpose, then I would probably cache these values in a small database and stat .htaccess files for modification times, rather than parsing an indeterminate number of .htaccess files on every single hit on a server asset. I could in fact do exactly this (and am possibly about to), but before I reinvent the wheel, does does anyone know of a way in which I can make use of apache's inherent ability to collate this data?
Hope this is clear. Thankyou very much for any help
Clancy