From: Joby W. <joby@u.washington.edu> - 2002-09-17 21:26:02
|
Thanks for the comments Jeff. I wasn't actually proposing that we (or I, as if I had the skill...) write the bindings for Webmin or a Gnome/KDE plugin, just that this model would make it a bit easier to do so if desired in the future. I just want to propose a more atomic structure for the configuration files. We have the following goals for our config file structure: 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. Seperate config-user.php and config-dist.php files does (1). Having the config-user and config-dist files be in php does (2). (3) can be done in a variety of ways, but in my proposal config-valid.php's only purpose is to be authoritiative. By putting validation and only validation in one file we can design a clean interface so that the validation tools can be used by a variety of interfaces and those interfaces should not need significant management to maintain compatability over time. > >>class valid_bool{ > > ... > >> is_valid($new){ >> if(is_bool($new)){ >> $this->new = $new; >> return true; >> } >> } > > > Since it changes the state of the valid_bool object, > is_valid is a BAD, BAD method name. (Should be, > maybe, set_new(), or set_new_checked() or something > like that.) > Yeah I saw that just before I sent it, but since this was more for the idea rather than the actual code, I left it. Should have split is_valid() into is_valid() and set_new() and have set_new() call is_valid(). jbw |