Note: Configuration are being kept in a PHP file, \[code\]config.php\[/code\].I've seen this done differently, here's a short list of examples (I'm storing DB info in these examples):Constants: global, readonly\[code\]define('DB_USER','user12');define('DB_PASS','21user');\[/code\]Using GLOBALS array: global, changeable, repetitive, mixed with other globals\[code\]$GLOBALS['DB_USER']='user12';$GLOBALS['DB_PASS']='21user';\[/code\]Using a non-global array but raised globaly: possibly worse than the 2nd option\[code\]$config=array(); ...$config['DB_USER']='user12';$config['DB_PASS']='21user';... global $config; mysql_connect('localhost',$config['DB_USER'],$config['DB_PASS']);\[/code\]Defining class properties: (global, enumerable)\[code\]class Config { public $DB_USER='user12'; public $DB_PASS='21user';}\[/code\]Criteria/Options/Features:
- ease of coding: you wouldn't want to check if the setting exists, or initialize it
- ease of modification: a non-programmer/layman could easily modify the settings
- stored in a clean place: not mixed with other variables (can be stored in a sub-array)
- runtime modification: in some cases, other devs may easily modify existing settings