Re: Config class
| From: | Chuck Hagenbuch | Date: | Thu, 25 Jul 2002 17:57:41 +0000 |
| Subject: | Re: Config class | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7998@lists.php.net to get a copy of this message | ||
Quoting Bertrand Mansion <bmansion@mamasam.com>:
> Yes, I would like to add methods for delete, add, replace lines in config
> files. Presently, configuration parameter lines are not stored in the
> data array, I would like to add that.
Along the lines of general PEAR config stuff, I just wrote a config system
for Horde which:
1. Has a conf.xml file as the master source for what values there are and
what their defaults are.
2. Also reads defaults from a conf.php, so that a users existing settings
are respected any time the config system is run.
3. Uses a Horde form library to auto-generate a UI from the .xml, which
includes type information (is this config item a string, a boolean, a select
list) and descriptions, so all the metadata for the config information is
there in the XML.
4. Writes out (or generates for cut+paste, or whatever) the new conf.php,
which is a nicely compact .php file (comments aren't really needed since
it's maintained by the system, and the comments will always be there in the
XML).
Now that the PEAR installer is more or less working, I'd be up for putting
more libs and stuff like this into PEAR, if anyone's interested.
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
"After a few minutes the most aromatic and nice smelling Italian coffee
will come out of the exhaustpipe." - Our stove-top espresso pot