show Environment<4K error

pull/397/merge v3.3
qkqpttgf 2021-08-18 05:14:16 +00:00 committed by GitHub
parent 7e5fc7c502
commit 3d67d57ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -112,7 +112,7 @@ function setConfig($arr, $disktag = '')
$operatedisk = 1; $operatedisk = 1;
} elseif ($k=='disktag_copy') { } elseif ($k=='disktag_copy') {
$newtag = $v . '_' . date("Ymd_His"); $newtag = $v . '_' . date("Ymd_His");
$tagvalue = getConfig($v); $tagvalue = getenv($v);
if (is_array($tagvalue)) $tmp[$newtag] = json_encode($tagvalue); if (is_array($tagvalue)) $tmp[$newtag] = json_encode($tagvalue);
else $tmp[$newtag] = $tagvalue; else $tmp[$newtag] = $tagvalue;
array_push($disktags, $newtag); array_push($disktags, $newtag);
@ -136,7 +136,7 @@ function setConfig($arr, $disktag = '')
else array_push($tags, $tag); else array_push($tags, $tag);
} }
$tmp['disktag'] = implode('|', $tags); $tmp['disktag'] = implode('|', $tags);
$tagvalue = getConfig($arr['disktag_rename']); $tagvalue = getenv($arr['disktag_rename']);
if (is_array($tagvalue)) $tmp[$arr['disktag_newname']] = json_encode($tagvalue); if (is_array($tagvalue)) $tmp[$arr['disktag_newname']] = json_encode($tagvalue);
else $tmp[$arr['disktag_newname']] = $tagvalue; else $tmp[$arr['disktag_newname']] = $tagvalue;
$tmp[$arr['disktag_rename']] = null; $tmp[$arr['disktag_rename']] = null;
@ -149,8 +149,9 @@ function setConfig($arr, $disktag = '')
} }
foreach ($tmp as $key => $val) if ($val=='') $tmp[$key]=null; foreach ($tmp as $key => $val) if ($val=='') $tmp[$key]=null;
//error_log1(json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp' . json_encode($tmp, JSON_PRETTY_PRINT));
//echo json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp' . json_encode($tmp, JSON_PRETTY_PRINT);
return setVercelConfig($tmp, getConfig('HerokuappId'), getConfig('APIKey')); return setVercelConfig($tmp, getConfig('HerokuappId'), getConfig('APIKey'));
error_log1(json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp' . json_encode($tmp, JSON_PRETTY_PRINT));
} }
function install() function install()
@ -326,10 +327,10 @@ function setVercelConfig($envs, $appId, $token)
} else { } else {
if ($value) $response = curl("POST", $url, json_encode($tmp), $header); if ($value) $response = curl("POST", $url, json_encode($tmp), $header);
} }
//echo $key . ":" . $value . ", " . json_encode($response, JSON_PRETTY_PRINT) . "<br>"; //echo $key . " = " . $value . ", <br>" . json_encode($response, JSON_PRETTY_PRINT) . "<br>";
if ($response['stat']!=200) return $response['body'];
} }
return VercelUpdate($appId, $token); return VercelUpdate($appId, $token);
//return $response;
} }
function VercelUpdate($appId, $token, $sourcePath = "") function VercelUpdate($appId, $token, $sourcePath = "")