Welcome Guest, Not a member yet? Register   Sign In
Client manageable configuration variables - how to properly set it up?
#1

[eluser]clone45[/eluser]
Hello,

There are a handful of configuration variables that I want to make editable for my clients. For example: "contact email address" or "aviary api key". I intend to create a form that allows those specific configuration variables to be edited from within our content management system. I know that there are probably tons of ways to set this up, but I'm looking for people's advice on the subject. Here's what I've considered so far:

1. Store the configuration data in a database table similar to how wordpress does it.

Pros: Easy to code
Cons: Unless caching is used, introduces an extra database query for every page

2. Store the configuration in an .ini file or xml document similar to how phpmyadmin does it.

Pros: Also easy to code.
Cons: Requires the file be loaded and parsed on every page load. (However, previously I've used Zend and my routes files were pretty large. Loading and parsing those route files didn't slow things down too much.)

I'm leaning toward #2, but if anyone has strong opinions, I'd love to hear them.

Thanks,
- Bret
#2

[eluser]Aken[/eluser]
Both solutions are fairly low-key, and can be cached / stored with sessions as necessary. It kind of depends on the type of config settings and where / how they'll be used. Typically I stick with flat files. You can store settings as serialized arrays, JSON, ini format, etc. Lots of ways!
#3

[eluser]clone45[/eluser]
Thanks for the feedback. I decided to go with simple .ini files. They're good enough for my uses. :-)

Cheers,
- Bret




Theme © iAndrew 2016 - Forum software by © MyBB