如何访问CloudControl config.free配置变量

如何访问CloudControl config.free配置变量,cloudcontrol,Cloudcontrol,如何访问CloudControl config.free config_VARS?由于没有很好的文档记录,答案如下: if ($credFile = getenv('CRED_FILE')) { $credFileContents = file_get_contents($credFile); if ($credFileContents !== false) { $credData = json_decode($credFileContents, true);

如何访问CloudControl config.free config_VARS?

由于没有很好的文档记录,答案如下:

if ($credFile = getenv('CRED_FILE')) {
    $credFileContents = file_get_contents($credFile);
    if ($credFileContents !== false) {
        $credData = json_decode($credFileContents, true);
        $value = $credData['CONFIG']['CONFIG_VARS']['MY_VAR'];
    }
}

这意味着在
CRED_文件
中,config addon有其相应的array/section
config
,其中包含另一个数组/节
config_VARS
,该数组/节随后包含您的VARS。

由于没有很好的文档记录,因此答案如下:

if ($credFile = getenv('CRED_FILE')) {
    $credFileContents = file_get_contents($credFile);
    if ($credFileContents !== false) {
        $credData = json_decode($credFileContents, true);
        $value = $credData['CONFIG']['CONFIG_VARS']['MY_VAR'];
    }
}

这意味着在
CRED_文件
中,config addon有其相应的array/section
config
,其中包含另一个数组/节
config_VARS
,然后包含您的VARS。

相关文档站点是,但您的代码基本相同。感谢您的参考!也许这可以链接到相关的文档站点,但是你的代码基本上是一样的。谢谢你的参考!也许这可以联系在一起