Menu

#26 Configuration storage/retrieval API

v0.3
open
7
2006-01-12
2006-01-11
No

Add an API for setting and getting various
configuration parameters that are currently stored in
the config.php file. This includes things like
"show_images", "number of feeds to show", etc.

There has been some concern by users that they are
worried about losing these changes if they lose their
db. The API could abstract whether the configs were
stored in a db or file, and provide an interface for both.

A better solution may just be to store them in a DB,
and save out a config file backup whenever a change is
made. Or atleast an option to write a backup is saved
in the configs.

Also keep in mind the desirability to support multiple
users which may have different configs. This may be too
difficult, or user-specific settings stored in another
table.

Discussion

  • Andrew Turner

    Andrew Turner - 2006-01-12
    • assigned_to: nobody --> keb189
     
  • Katie Bechtold

    Katie Bechtold - 2006-01-27

    Logged In: YES
    user_id=891937

    I've added a sort of API for storing and retriving
    configuration parameters. They're stored in a new database
    table that has one column for each parameter and one row for
    each 'configuration' (set of parameter values). Right now
    there's only one universal 'configuration', but more rows
    can be added to accommodate multiple users with their own
    configurations or multiple configurations for the same user.
    A call to fof_get_config() in init.php loads those values
    from the database into the $config[] hash, where each value
    can be referenced by its column name (e.g.,
    $config['posts_per_page']). Values can be stored with a
    call to fof_save_config_item().

    I don't see a specific need to back up this database (and
    none of the others) to a file for a user. I feel this is
    the database administrator's job. If we want to consider
    automatic backups for the user, at any rate I think a new
    feature request should be opened for that.

     
  • Katie Bechtold

    Katie Bechtold - 2006-02-01

    Logged In: YES
    user_id=891937

    I've re-done the configuration table so that it's now a set
    of name/value pairs. A new file 'default.config' contains a
    set of default configuration parameters that's loaded prior
    to querying the database for those parameters (which would
    override the default values). You'll want to run
    install.php to get the new schema for
    the configuration table.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.