我需要在PHP中存储一堆配置信息.
我考虑过以下......
// Doesn't seem right.
$mysqlPass = 'password'; 
// Seems slightly better.
$config = array(
     'mysql_pass' => 'password'
);
// Seems dangerous having this data accessible by anything. but it can't be
// changed via this method.
define('MYSQL_PASSWORD', 'password'); 
// Don't know if this is such a good idea.
class Config
{
    const static MYSQL_PASSWORD = 'password';
}     
到目前为止,这是我所想到的.我打算将此配置信息导入到我的应用程序中require /config.inc.php.
对于存储配置数据有什么用处,以及有关此问题的最佳做法是什么?