From: Kevin <ke...@dr...> - 2006-01-28 17:50:14
|
I had a peek at the config table format. I disagree with the way it is implemented, what happens if we want another config option? We have to add a column to the table? That smells bad to me. What about something that just stores key -> value pairs? The key could use format like java properties to avoid name clashes and keep things logically grouped together. global.items.sort.column = publish_time global.items.sort.order = DESC feed.33.show_image = false global.language = 'DE' feed.33.update_interval = 3600 plugin.mycoolplugin.make_cool = true If one piece of code just cares about a subset of the config options, say for a feed, we can use the LIKE comparision operator in the query: select * from config_table where name LIKE 'global.items.%' or select * from config_table where name LIKE 'feed.33.%' default config options should probably go in a php file instead of the database. That will make it easier to handle upgrades, just overwrite the file. The db of course will override anything in the default file. |