Re: [PATCH] Configuration files

On Thu, Nov 11, 1999 at 02:52:38AM +0100, Terje Bless wrote:
> Here is a patch ("dbfile.diff") that moves the various giant hashes into
> configuration files instead of hard-coding them.

Definitely a good idea... applied, the diff is at:

    http://dev.w3.org/cvsweb/validator/httpd/cgi-bin/check.diff?r1=1.48&r2=1.49

> There are 3 files created from the 3 hashes for: FPI ->
> plaintext version, Error message -> URI fragment, and HTML
> Element Name -> URI fragment. I've included these files
> ("fpis.cfg", "frag.cfg", "eref.cfg") as attachements. They go
> in the "htdocs" directory by default, but this is configurable.

I decided to add an extra directory in htdocs called "config".

> The config files are simple TAB delimited files. Multiple TABs are accepted
> and empty lines, lines containing only whitespace, and lines containing
> only a comment (a "#" optionally preceeded by whitespace). This means keys
> and values can contan any character except TAB and "#".
> 
> The sub that reads the files is intentionally generic -- so it can be
> re-used for future config files -- and is used for all 3 files.

That's pretty much exactly how I would've done it if I did it
over again. :)

Thanks!

-- 
Gerald Oskoboiny       <gerald@w3.org>  +1 617 253 2920
System Administrator   http://www.w3.org/People/Gerald/
World Wide Web Consortium (W3C)      http://www.w3.org/

Received on Tuesday, 30 November 1999 21:52:14 UTC