using 'sys_config' vs 'sys_ini' table?

Discussion in 'Developers' Forum' started by cfoe, Jul 31, 2012.

  1. cfoe

    cfoe ISPConfig Developer

    I need to add some vars for the templates to the db.

    Could or should I use
    sys_config table or
    sys_ini table

    or should I add a new table?
  2. till

    till Super Moderator

    If the variables are available for all themes or general interface settings, then please use sys_ini table. The variables are defined in the system.ini file in the install/conf/ folder and in the form and template file of the interface config form. No database fields have to be added.
  3. cfoe

    cfoe ISPConfig Developer

    and for theme specific parameters?
  4. till

    till Super Moderator

    Good questions indeed :) Maybe we should use the sys_ini table for this.
  5. cfoe

    cfoe ISPConfig Developer

    The structure of the sys_config table is a little more complex and I think it will leave a lot more leeway for future extension.
    What have you planned to put in there?

    EDIT/ADD: Or a new table? Like 'sys_tpl' ?
    Last edited: Jul 31, 2012
  6. till

    till Super Moderator

    I had planned to use the sys_config table as general key value store and to implement user defined overrides for default values with it ( The sys_ini system that we use for server and interface values at the moment is easy and works fine, but in case that we reach the limits of the ini style storage in future (e.g. requirements for multiline values), it might be migrated to sys_config values as well.

    Thats an option too. But then we might have to write some kind of script in the installer / updater that automatically detects the existing themes and adds them to this table, so that we replace the current "scan dir" like functionality for themes with a table that holds the details of the themes and some default values..

    Which values do you plan to store for the theme?
  7. cfoe

    cfoe ISPConfig Developer

    I was planning to make "branding" totally global but I had to realize that if themes should be as flexible as possible branding needs to vary on a theme basis.
    for example the logo might need different dimensions.

    one more thing to consider is the future possibility to set branding on a per user/per reseller basis. (maybe for 3.0.6)
  8. cfoe

    cfoe ISPConfig Developer

    I have added tables in the format of

    for the standard themes: tpl_default + tpl_default-v2

    Tables and config pages will not be required for a theme but will be possible by 3.0.5 to make parameters changeable within the frontend
  9. till

    till Super Moderator

    I dont think that its a good idea to have a table for each theme, this will clutter the database and each table will have just one record anyway.

    We should change this to one table "sys_user_theme" or "sys_theme" to match the naming scheme and the table has a field for the theme name.
  10. cfoe

    cfoe ISPConfig Developer

    how many themes do you want to install?

    I think I will be happy with 1.

    But I think we can manage with 1 table for most themes
  11. till

    till Super Moderator

    I dont install any themes at all and use the default one, but I'am most likely not the common user :) I guess most users try out several themes and this will clutter the database and having the theme name in a database table is not a good choice in my opinion.

Share This Page