![]() Topic awaiting preservation: PHP: Best way to configure a site. (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: f(x) |
![]() 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 |
![]() 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) |
![]() |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() 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) |
![]() Yes, I agree templates do help. code: $cfg['db']['tbl'][2]
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Actually I've used a combination. |