我在使用 appfog 服务配置 cakephp 数据库连接时遇到了一些问题。
AppFog 像这样通过 VCAP_SERVICES 变量提供 JSON 数据库配置
{
"mysql-5.1" = (
{
credentials = {
host = "ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com";
hostname = "ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com";
name = ?????????????;
password = ????;
port = 3306;
user = ?????;
username = ???????????;
};
label = "mysql-5.1";
name = "???????-mysql-56200";
plan = free;
tags = (
mysql,
"mysql-5.1",
relational
);
}
); }
在像这样的 cakephp 数据库配置文件中
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => $mysql_config["hostname"],
'login' => $mysql_config["username"],
'password' => $mysql_config["password"],
'database' => $mysql_config["name"],
'prefix' => '',
//'encoding' => 'utf8',
);
如何解决这个问题?