NYCPHP Meetup

NYPHP.org

[nycphp-talk] Config file format and admin suggestions

Kenneth Downs ken at secdat.com
Mon May 21 08:50:48 EDT 2007


Cliff Hirsch wrote:
> My config files are currently a bunch of define statements. I'm going 
> to change the format as I rewrite the admin back-end and am looking 
> for suggestions --- anything from database storge to yaml files.

Probably the first thing you want to do is break them out.  Database is 
good for things that users (including admins) can change.  If it will 
not be changed by the user, only by the programmer, it is by definition 
code and should be managed with the rest of the code, not in the database.

That being said, I've just gotten into YAML myself for that stuff, and 
like it a lot.  I tend to think of it as associative arrays with less 
typing.  Gives you complete freedom on structure.

The other possibility I have not seen mentioned yet is to type the 
configs directly into associative arrays.  This is a bit of a pain, but 
it does solve all of the parsing problems.

>
> I'm leaning towards PEAR Config to get me going. It appears to be 
> fairly flexible, but it doesn't support yaml or a DB-based container. 
> I'm also curious about how people go about setting available white 
> list values, default values, etc. without hardcoding them.
>
> Ideas? Suggestions?
>
> Cliff
> ------------------------------------------------------------------------
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php


-- 
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com    www.andromeda-project.org
631-689-7200   Fax: 631-689-0527
cell: 631-379-0010

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070521/da42ecb6/attachment.html>


More information about the talk mailing list