TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Site configurations in database? (http://www.talkphp.com/general/1741-site-configurations-database.html)

Haris 12-15-2007 12:46 AM

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?

TlcAndres 12-15-2007 01:04 AM

I store my configuration within a database simply because it's cleaner and creates less of a file mess.

CMellor 12-15-2007 02:44 AM

Database, as it's easier to view what you need and to edit it, and also it's cleaner.

xenon 12-15-2007 10:54 AM

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.

Salathe 12-15-2007 01:26 PM

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.

Haris 12-15-2007 03:26 PM

Quote:

Originally Posted by Salathe (Post 6683)
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.

I'm confused. How would you differentiate settings and configurations? :-)

TlcAndres 12-15-2007 04:54 PM

He probably refers to MySQL username, pass etc and root directory and such where as settings are the site's title and such.

Salathe 12-15-2007 05:05 PM

Quote:

Originally Posted by Haris (Post 6684)
I'm confused. How would you differentiate settings and configurations? :-)

I tend to use the term configuration for things that need to be 'correct' for the application to work. Settings are things that can be changed to have some sort of effect on the application but generally changing a setting should lead to the application no longer working as expected. But that's just my own differentiation because I see them as two entirely different sets of 'things'.

kevthedude 12-15-2007 05:47 PM

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