[Fusionforge-general] RFC: My “unified configuration system” proposal

Roland Mas lolando at debian.org
Mon Dec 21 20:07:37 CET 2009


  Hi again,

  I'm happy to see that this subject actually inspires people :-)
Thanks for the feedback, both on list, on IRC and in private email.  I
think I took into account most of what's in the scope of the current
implementation:
- now uses a singleton to ease unit testing;
- added unit testing, with mock configuration support;
- made section optional in calls to fusionforge_get_config;
- implemented fusionforge_get_config_array() to get several items at
once;
- also implemented fusionforge_set_vars_from_config() to set global
variables from configuration settings;
- renamed fusionforge.ini to config.ini.

  Here's the updated patch.  I filtered out the bulk of the
$GLOBALS['sys_name'] to fusionforge_get_config('forge_name') conversion,
but the “interesting” stuff is there.  The unit tests in particular are
probably worth a look.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fusionforge-trunk+unified-config.diff
Type: text/x-diff
Size: 13006 bytes
Desc: Unified config system, take two
URL: <http://lists.fusionforge.org/pipermail/fusionforge-general/attachments/20091221/09e25dd3/attachment.diff>
-------------- next part --------------

Roland.
-- 
Roland Mas

Late frost burns the bloom / Would a fool not let the belt / Restrain the body?
  -- in Good Omens (Terry Pratchett and Neil Gaiman)


More information about the Fusionforge-general mailing list