From: Antti <an...@io...> - 2004-07-19 14:25:14
|
> If multi-leveled .ini-style configuration files look appealing to you, > please respond & I'll post an alternative implementation handling > unlimited (almost) depth to this list (or to the OI2 patch manager). I mailed Chris a patch for "unlimited levels" several weeks ago and had a conversation about the issue. I understood that Chris has philosophical reasons not to include such a patch since understanding an ini-file with more than 3 levels of hashes is hard for a human - and thus hard to write and maintain. I really disagreed with the absolute limiting to 3 levels. I understood his arguments but preferred to let people themselves decide wether they want to use more than 3 levels. After a while of using my unlimited-level-ini-parser I have begun to understand his points more clearly and have converted all our own ini structures to use only two levels. And I encourage you to do the same if you ever plan to let anyone else modify your ini files x) There are however some situations where SPOPS object for example can not be initialized with only 3 levels.. (has_a / links_to relations with custom key, and your example to name a few). I have understood that handling of these structures is a bit under construction but Chris suggested earlier that at least has_a and links_to would follow the following syntax: [myspops has_a] OpenInteract2::MyObject = cystom_key: column_id I have understood that handling of has_a relations like this is in the CVS for testing the concept but I myself have not yet had the time to test it.. According to this syntax the configuration you would probably end up with would be: [bla creation_security] u = WRITE g = 3: READ g = 2: WRITE w = READ ro g separated as ; : g = 3: READ; 2: WRITE This ofcourse does not yet work :) To help these transformations Chris wrote OpenInteract2::Config::Initializer class which is used to convert ini files values to other form upon reading. You can define your own class for this purpose under [system_class] in server.ini if you wish to do custom transformations. - Antti |