There have been a couple bugs reported related wrong versions of TWiki.cfg used with recent versions of the source due to missing config variables. I've had this problem myself while developing once or twice.
Its worth specifying a basic requirement for the additional of new config and a direction the
ConfigManagement should go. Particular when we start being able to run several TWiki's from the same source base. (Its possible now, but it could be easier.)
Something allow the structure of
http://search.cpan.org/search?dist=Config-General
is worth looking at.
A minumun requirement for a
ConfigManagement scheme is that all 'non-critical' variable specify a default behaviour. ie. debug variables are generally off. Then there explicit declaration or non-declaration would be required not to break the core functionality.
At certain level it would also be nice to specific a bare minimum to get a web interface working, then allow
ConfigManagement through a web interface. See FAQ-O-MANTIC for something like this.
--
NicholasLee - 23 May 2001
Good idea.
--
JohnTalintyre - 23 May 2001
The problem I had was with wikicfg.pm not matching the other code's version (missing one variable from wikicfg.pm, which broke lots of things in non-obvious ways). When a new variable is introduced, perhaps the rule should be that the new code should always work even if the variable is absent (i.e. generate an error message immediately, or use a default and warn).
Alternatively, every time the required variables in the config file are changed, an 'expected Twiki version' could be incremented and compared to that of the main Twiki code. This requires version numbering for Twiki, and it might be cleaner to have a separate 'config variables version' number that increases separately to the main TWiki version/date.
--
RichardDonkin - 12 Jun 2001
The
TWikiUnixInstaller helps somewhat with this since it does two things:
- Tries to move all localised configuration into a configuration directory (twiki/etc
- Moves all code into a system directory - means that this can be synced between sites, who then read their config from the etc directory.
- Uses a config file rather than perl file - which means the idiom:
-
$configVar = $configFromFile{KEY} || "default" Can be used. (It doesn't at present, but based on reading this topic, this would be a good idea, but then I am doing some updates to it at the moment.) Currently it uses the almost as good idiom of:
-
$configVar = "$configFromFile{KEY}"
This approach was taken because it needed to work around this very issue!
--
MichaelSparks - 21 Jun 2003
This has beel "solved" with the advent of the
config script.
--
RafaelAlvarez - 15 Sep 2008