From: Aredridel <rs...@nb...> - 2002-09-17 19:50:48
|
Having defaults (loaded first) and a user-override file makes a lot of sense -- it's easy to parse, and easy to write a configurator for. That'd be my preference for sure. If one uses a configurator, the defaults could be coded into a load-configuration routine, leaving the option typing and structure in code, where it's most flexible and doesn't involve writing any parser. Having a configurator spit out a file to upload isn't too bad, and I like the idea of a CLI configurator. Downsides: If done this way, a configurator would either have to parse PHP or be written in PHP -- not an issue I think, since this /is/ PHPWiki, and there's no sense in using something else since this is a prerequisite for the rest of the project anyway. Simplicity is a good thing, as is a central place for configuration in the code. In my own projects, I use defines if not defined in my libraries, and to override, just define before require. Documenting settings is easy, really, and a configurator could serve as documentation rather easily. The system is scalable, and defines are a plus since they're inherently superglobal even in PHP3, so no version messes to deal with. Code optimizers deal with them efficiently, and the parse time on my several thousand lines of code is milliseconds. Ari |