User Profile

User
 iamcam
Location
 San Diego
URL
 http://www.mistercameron.com/

Recent Articles

Simply storing config values in the DB

There are many situations in web apps where site-wide configurations need to be accessible to users through admin interfaces, rather than configuration files residing on the server. It is a practical method of storing configuration values that may need changing from time to time, but without access to the core configuration file.
  • Published by iamcam 10/26/08 - 18:48
  • 10928 views
  • 5 comments

Recent Comments

Posted 05/11/2009 03:21pm
@Ryan
I like this. Definitely something I will probably use in the future.

@Gediminas
There's probably a decent benchmark on the web somewhere. I think the general argument of writing rules into the vhost file is that you get a performance boost b/c the rules are loaded into memory when Apache starts up. .htaccess files are read and parsed each time the site/directory is accessed. I'm not an Apache guru, so I could be wrong.
Posted 11/04/2009 01:04pm
I suppose this could also be used for user feedback on forms that submit to email? I'd imagine the spam content is somewhat similar if it's coming from a bot trolling for forms.
Posted 03/11/2008 02:11pm
The comments are appreciated.
@Jonah Turnquist: You're right - a flat file would just as well. Cake has a method to define a flat file used to store your configuration files. Either way should work fine.

@Christian Deluxe: That's definitely in the direction of another idea/method I had for storing values.

Perhaps one benefit to storing any config values in a database is that you can apply scope to the data being selected. Consider the situation in which you have several sites (subdomains?) running off of one set of Cake files and one database. Applying the scope of "mysite" to your select statement can be an easy way to segregate settings used on different web sites.
Posted 23/10/2008 12:22am
How can I get multiple istances of TinyMCE in the same page?
[I need for editing 2 languages] Thanks

Andrea,

That is addressed in the TinyMCE documentation. I haven't used that feature for any production work yet, but from what I remember it should be fairly straightforward. I think you tell TinyMCE to apply itself to all textareas with a specific class.