I have considered the following
$mysqlPass = 'password'; // doesn't seem right
$config['mysql_pass'] = 'password'; // seems slightly better
define('MYSQL_PASSWORD', 'password'); // seems dangerous having this data accessible by anything. but it can't be changed via this method
class Config
{
const static MYSQL_PASSWORD = 'password';
}
Config::MYSQL_PASSWORD; // don't know if this is a good idea
This is all I have thought of somewhere. I was going to have a require /config.inc.php with all these vars in. What works for you, and what are best practices concerning this?
Update
How would you store your directories variables? These are less of a security concern than a MySQL password, so would CONFIG_APP_ROOT, CONFIG_DIR_BASE etc be fine?