mRFC 0004: Midgard Configuration interfaces
Midgard websites and applications often have a lot of
configurationinformation and specialities that are mainly in
the minds of the original developer and cannot easily be
accessed by others. This RFC wants to do something about this.
Deprecation notice:
This mRFC has been deprecated with the MidCOM 2.4 component
base classes which provide easy way for component authors to
create an user interface to the configuration options.
The selfdocumenting component
The main goal is that all components should document the different configuration options they choose to use, and how these options should be stored so that it is easy for other administrators to edit these settings.
To do this we need to have a format for documenting different
configuration variables.
Midgard applications and mRFC0004
This mRFC only describes the format for making a
configurationschema and in time it will also document the API
for reading/writing configurations.
Also, this RFC defines which applications should follow this
RFC. This will be updated as new components and applications
define there relationship to mRFC004.
MidCom and mRFC0004
Every Midcom should create a snippet called config_schema in
the _conf snippetdirectory that conforms with the configschema
in this RFC that defines the configuration options available.
AIS will provide an interface for editing the sitegroupwide
configurationoptions. The user will be able to create new
configurationoptions on a topicbasis as well. Changes done to
the configuration on the topiclevel overrides the ones done on
the sitegrouplevel.
Schemaformats for configurationfiles
There are two options here:
1) Use a phparray that describes the options available.
The array has the form: (Note the variable name)
$MIDGARD_CONFIG = array ( storage => 'params | array' ,
nodes => array (
[node_name] = array (
'name' => string [field_name]
'comment' => string [node_comment]
'type' => string [ boolean|string|multienum|section]
'params' => array ( [type_params ])
'default' => string,
'advaced' => boolean // defaults to no if not set
)
)
);
Descriptions of the elements:
storage = How to store the configurationoptions, either as
midgard
parameters or as a complete array in a snippet.
name = the displayname of the configurationoption.
Example: "Redirect login"
comment = A comment to the option.
Example: "If you say yes here, the user will be redirected back
to the page he logged in from after a sucessfull login"
type = Type of configurationvariable.
params = array of prameters that help define the option.
Example:
type=> multienum, params => array ( 'live' , 'staging',
'midcom');
default = the default sensible value of this option.
advanced = if this option is defined as advanced and not an
option a user should have to deal with from day to day, this
parameter should be set.
2) Use a modified version of Horde_config class to parse xmlfiles thatm describe the options available.
References:
Horde_Config class:
http://cvs.horde.org/co.php/framework/Horde/Horde/Config.php?r=1.68
