One thing I dont get about this is why you need the "ftp_instances" key at all. I'd just have a bit of code that assumed that all Ini file sections whose name matches /^ftp/ are valid instances. Its easy enough to loop through the sections as needed, and it means that when somebody decides to delete one of the sections they dont have to remember to update the instances list, and it also means that if the users want to give the instances more descriptive names they can.

Also, an alternative for things like this is to use a DB for the config data. Of course that still leave the problem of where to put the DB connection details but allowing the user to manage their config through a web client or litte-gui may tickle their fancy more than using a config file.

---
demerphq


In reply to Re: Configuration file design by demerphq
in thread Configuration file design by castaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.