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. |
From: Andrew T. <ajt...@hi...> - 2006-01-28 18:05:07
|
I didn't realize the config stuff was already in CVS. I was wondering on the progress of that. I agree that config options should be addable without having to modify the actual database structure. Using Key->Value coding seems like the best option, and the ability then use 'namepspaces' or whatever is very nice for any plugin, feed, subsection to be able to write and retrieve config options. A very important one to add as a "global" is going to be the current db schema version, and perhaps even the FoFRedux version. This can at least be queried for the future in upgrades. Rails now uses a similar scheme to this. Any updates on tagging? :) Andy On 1/28/06, Kevin <ke...@dr...> wrote: > > 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 =3D publish_time > global.items.sort.order =3D DESC > feed.33.show_image =3D false > global.language =3D 'DE' > feed.33.update_interval =3D 3600 > plugin.mycoolplugin.make_cool =3D 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. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Fofredux-devel mailing list > Fof...@li... > https://lists.sourceforge.net/lists/listinfo/fofredux-devel > -- Andrew Turner ajt...@hi... 42.4266N x 83.4931W http://highearthorbit.com Northville, Michigan, USA |
From: Katie B. <ka...@ho...> - 2006-01-28 22:13:49
|
On Sat, Jan 28, 2006 at 10:54:37AM -0700, Kevin wrote: > What about something that just stores key -> value pairs? I like your design better than the current one. Do you want to go ahead and implement that (and have Andrew re-assign that Feature Request)? -- Katie Bechtold http://hoteldetective.org/ |
From: Kevin <ke...@dr...> - 2006-01-28 22:48:36
|
Katie Bechtold wrote: > On Sat, Jan 28, 2006 at 10:54:37AM -0700, Kevin wrote: > >> What about something that just stores key -> value pairs? >> > > I like your design better than the current one. Do you want to go > ahead and implement that (and have Andrew re-assign that Feature > Request)? > > It will have to wait until after tags is complete. The table is fairly simple. Just 2 columns, name & value. create table $FOF_CONFIG_TABLE ( name varchar(250) NOT NULL, value varchar(250) NOT NULL PRIMARY KEY(name) ) Then just 2 functions are needed for retrieving and adding/updating values. fof_get_config_value( $name ); fof_set_config_value( $name, $value ); This doesn't put any restrictions on names or values. Some standards should be adopted for acceptable names and values. -Kevin |
From: Katie B. <ka...@ho...> - 2006-01-29 23:12:44
|
On Sat, Jan 28, 2006 at 03:45:02PM -0700, Kevin wrote: > The table is fairly simple. Just 2 columns, name & value. The schema you're suggesting doesn't allow for multiple configurations (e.g., one per user). Is this okay with everyone? It could of course be modified to add a column for "configuration identifier", so a certain configuration set could be queried with "SELECT * from config_table where config_id=7", for example, giving you all the rows pertinent to that configuration "set". -- Katie Bechtold http://hoteldetective.org/ Hoare's Law of Large Problems: Inside every large problem is a small problem struggling to get out. |
From: Kevin <ke...@dr...> - 2006-01-29 23:26:55
|
Katie Bechtold wrote: > On Sat, Jan 28, 2006 at 03:45:02PM -0700, Kevin wrote: > >> The table is fairly simple. Just 2 columns, name & value. >> > > The schema you're suggesting doesn't allow for multiple > configurations (e.g., one per user). Is this okay with everyone? > It could of course be modified to add a column for "configuration > identifier", so a certain configuration set could be queried with > "SELECT * from config_table where config_id=7", for example, giving > you all the rows pertinent to that configuration "set". > > That will work. I assume the other tables need to have a similar column to separate each users' feeds/items, etc. |
From: Andrew T. <ajt...@hi...> - 2006-01-29 23:37:43
|
So there will be multiple instances of pref keys, one per user? Sounds very good - expandable preferences, multiple users - yay! When do you think you can work your hacking skills on this Katie? Looking forward to trying it out. Andy On 1/29/06, Kevin <ke...@dr...> wrote: > Katie Bechtold wrote: > > On Sat, Jan 28, 2006 at 03:45:02PM -0700, Kevin wrote: > > > >> The table is fairly simple. Just 2 columns, name & value. > >> > > > > The schema you're suggesting doesn't allow for multiple > > configurations (e.g., one per user). Is this okay with everyone? > > It could of course be modified to add a column for "configuration > > identifier", so a certain configuration set could be queried with > > "SELECT * from config_table where config_id=3D7", for example, giving > > you all the rows pertinent to that configuration "set". > > > > > That will work. I assume the other tables need to have a similar column > to separate each users' feeds/items, etc. > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Fofredux-devel mailing list > Fof...@li... > https://lists.sourceforge.net/lists/listinfo/fofredux-devel > -- Andrew Turner ajt...@hi... 42.4266N x 83.4931W http://highearthorbit.com Northville, Michigan, USA |
From: Katie B. <ka...@ho...> - 2006-01-30 22:41:17
|
On Sun, Jan 29, 2006 at 04:31:17PM -0700, Kevin wrote: > That will work. I assume the other tables need to have a similar column > to separate each users' feeds/items, etc. On second thought, it seems to me this additional-column idea should wait until we make a concerted effort to multi-user-ize Feedonfeeds-Redux. 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. -- Katie Bechtold http://hoteldetective.org/ |