PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Oct 16, 2019 3:20 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Site Settings (Location)
PostPosted: Thu Nov 24, 2011 9:52 pm 
Offline
Forum Commoner

Joined: Mon Nov 21, 2011 1:16 am
Posts: 69
I'm looking for everyones opinions of where they prefer to store site settings. (Everything from sensitive settings, to what theme a user has selected.) Cookies, Text File on Server, MySQL database, ect.

In addition to providing your preference of where and how your store site settings; explain why; and include security advantages/disadvantages. (Thank you in advance for your time.)


Top
 Profile  
 
PostPosted: Fri Nov 25, 2011 12:09 am 
Offline
Tranquility In Moderation
User avatar

Joined: Sun Feb 06, 2005 8:18 pm
Posts: 5001
Location: Indiana
I'm not sure I do it in the most secure way, but..

I place non-login (NOT email, database, etc info) details in a database row in it's own table. It's often in the main database that all the other queries go to. Thinking about it, I should place it in a separate database with a separate database login.

I either hardcode the login and extremely sensitive data in a regular .php file above document root in an ini file above document root. Occasionally I have hardcoded these values into an include file (such as a dbconnect.php).

_________________
- A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.


Top
 Profile  
 
PostPosted: Tue Nov 29, 2011 5:03 am 
Offline
Forum Contributor

Joined: Mon Nov 21, 2011 4:40 am
Posts: 142
For all environment dependent configuration I use ini files (easy Zend Framework way :) )
Example:
Syntax: [ Download ] [ Hide ]
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[general]


For general application configuration (which sometimes can be set from config planel i use XML files. Easy to handle generic setters and getters e.g. $config->getUserTimeout(); or $config->setUserTimeout(); when we have <UserTimeout>22</UserTimeout>. Really easy to maintain.

All user related stuff i keep in DB - in most cases in one DB with the rest of data.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group