![]() |
Site configurations in database?
Well, I've seen wordpress store site configurations inside database.
I usually store them in a configuration file BUT found database much more cleaner. Where do you store site configurations, and why? What type of configurations do you store? |
I store my configuration within a database simply because it's cleaner and creates less of a file mess.
|
Database, as it's easier to view what you need and to edit it, and also it's cleaner.
|
I'd say it depends on what exactly you need to store. Database settings, base paths and cookie settings go into config files, and base urls, theme directories, images dirs, site name, etc. go into the database (in my apps). You can't just store EVERYTHING in the database. Depends on what level of flexibility you need on an application. I used for a long time .php config files (and settings inside it were stored as a big array), but I consider moving to .ini files.
|
It depends on the site really. For most "web apps", storing settings (different from 'configuration' in my eyes) in the database will be fine. However, sometimes you might not want to incur the penalty of loading up the database and retrieving settings either site-wide or for specific pages when you won't be making use of the database in any other way.
|
Quote:
|
He probably refers to MySQL username, pass etc and root directory and such where as settings are the site's title and such.
|
Quote:
|
It really depends on what I'm doing. If I make a small script that doesn't need to use any databases that I plan to release to the public then I store the settings in a file. However, for any of my own personal websites I do use a configuration database. Just much faster and simpler to use.
|
| All times are GMT. The time now is 11:39 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0