TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-15-2007, 12:46 AM   #1 (permalink)
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default 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?
__________________
Necessity is the mother of invention.

My blog
Haris is offline  
Reply With Quote
Old 12-15-2007, 01:04 AM   #2 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

I store my configuration within a database simply because it's cleaner and creates less of a file mess.
TlcAndres is offline  
Reply With Quote
Old 12-15-2007, 02:44 AM   #3 (permalink)
The Acquainted
Upcoming Programmer 
 
CMellor's Avatar
 
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
CMellor is on a distinguished road
Default

Database, as it's easier to view what you need and to edit it, and also it's cleaner.
__________________
Not quite a n00b...
CMellor is offline  
Reply With Quote
Old 12-15-2007, 10:54 AM   #4 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

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.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 12-15-2007, 01:26 PM   #5 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 12-15-2007, 03:26 PM   #6 (permalink)
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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?
__________________
Necessity is the mother of invention.

My blog
Haris is offline  
Reply With Quote
Old 12-15-2007, 04:54 PM   #7 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

He probably refers to MySQL username, pass etc and root directory and such where as settings are the site's title and such.
TlcAndres is offline  
Reply With Quote
Old 12-15-2007, 05:05 PM   #8 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Haris View Post
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'.
Salathe is offline  
Reply With Quote
Old 12-15-2007, 05:47 PM   #9 (permalink)
The Wanderer
 
Join Date: Dec 2007
Posts: 7
Thanks: 2
kevthedude is on a distinguished road
Default

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.
kevthedude is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:45 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design