From: Joby W. <joby@u.washington.edu> - 2002-10-15 15:06:04
|
Martin Geisler wrote: > This annoys me too in my own Wiki - when I update from CVS, I have to > put my changes to the DB settings back into index.php each time. > > Wouldn't it be better if the file with the local settings was outside > CVS? That should make it easy for users to update their copy. > > The index.php file could then include the local settings first, and > then fill in the missing parts along the lines of how lib/config.php > currently checks the configuration from index.php. > Yes. We had this discussion as a part of the argument over how to implement a configuration scheme. And pretty much concluded: 1) index.php: would not contain any config data just includes, and possibly the invocation of main(). 2) config-dist.php: configuration file with default include/variable values. 3) config-user.php: a particular wiki's config data (only includes values if different from config-dist.php. The discussion was how to generate config-user.php. I proposed that there also be a config-valid.php, which would include classes to provide potential values or ranges of values and validate a config setting. This file would be the single authoritative source for config variables (can generate config-dist.php and config-user.php), which could be used by Configurator.php (web-based config) or a command line interface configurator (cli-config.php). This would profide: 1) Seperation between user settings and defaults 2) No parsing to get user or default settings (this is ok for a daemon, but for a script that has to reparse for each pageview, it is just more overhead). 3) One authoritative source for config variables and the potential values for those variables. 4) Clean interfaces which increase flexability and will decrease breakage over time. jbw |