Im trying to figure out a more clever way to handle a sites config than the 'usual one'.
Im having around 30 settings atm, which is located in config.php. All vars goes like this:
$config['picture']['max_upload_size'] = 1048576;
My proposal would be a config.class.php, something like this:
class config {
const tblForums = 'Forums';
private $image = array(
'max_upload_size' => 1048576
);
private $db = array(
'db_user' => 'username'
);
public static function get($type, $setting) {
return $$type[$setting];
}
}
OR
do something alike this, and just make it with a db backend.
Im not asking for a complete solution, just pros and cons .. 🙂