我想在应用程序生命周期中动态设置数据库凭据。由于我无法从调用我的编辑器自动加载器的类函数中执行此操作,因此我选择将数据表编辑器的 .config 文件编辑为此
require_once('../functions/functions.php');
//get db credentials
$db_credentials = get_db_credentials($_SESSION['MY_DATA']['tenant_uuid']);
$sql_details = array(
"type" => "Mysql",
"user" => $db_credentials['datastore_db_username'],
"pass" => $db_credentials['datastore_db_password'],
"db" => $db_credentials['datastore_db_name'],
"host" => $db_credentials['datastore_db_host'],
"dsn" => "",
"port" => "",
);
但是根据我的日志,我似乎无法访问会话变量
$_SESSION['MY_DATA']['tenant_uuid']
.
我错过了什么?