Topic awaiting preservation: PHP: Best way to configure a site. (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: f(x) |
posted 11-22-2005 00:22
I have been trying to find a good, flexible, portable, reliable way to configure a PHP website. So far I've been only stuffing all configuration vars in a $cfg array, but I don't know weather there's a better way or not. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 11-22-2005 01:13
If you look at most sites you will find that an array of variable tends to be used to store the configuration data. This will often be the fastest way to have your information stored, it will be immediately accessible to your forms. |
Bipolar (III) Inmate From: f(x) |
posted 11-22-2005 03:50 |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 11-22-2005 09:00
Config arrays or a lot of define('CONFIG_...') directives (loaded depending on HTTP_HOST, of course) and templates are usually the way to go. |
Bipolar (III) Inmate From: f(x) |
posted 11-23-2005 21:40
Yes, I agree templates do help. code: $cfg['db']['tbl'][2]
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-24-2005 01:46
Actually I've used a combination. |