From 87654f35ce8ecdd077c6a292e5435d71bc61a06d Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Thu, 6 Aug 2020 11:28:12 +0800
Subject: [PATCH] SCF:select save in env or file
---
.../{TencentSCF.php => TencentSCF_file.php} | 31 +++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
rename platform/{TencentSCF.php => TencentSCF_file.php} (90%)
diff --git a/platform/TencentSCF.php b/platform/TencentSCF_file.php
similarity index 90%
rename from platform/TencentSCF.php
rename to platform/TencentSCF_file.php
index 5eb867d..dd86fbe 100644
--- a/platform/TencentSCF.php
+++ b/platform/TencentSCF_file.php
@@ -170,12 +170,18 @@ function install()
$SecretKey = $_POST['SecretKey'];
$tmp['SecretKey'] = $SecretKey;
}
+ $tmp['ONEMANAGER_CONFIG_SAVE'] = $_POST['ONEMANAGER_CONFIG_SAVE'];
$response = json_decode(SetbaseConfig($tmp, $_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $SecretId, $SecretKey), true)['Response'];
if (api_error($response)) {
$html = api_error_msg($response);
$title = 'Error';
return message($html, $title, 201);
} else {
+ if ($tmp['ONEMANAGER_CONFIG_SAVE'] != 'file') {
+ $html = getconstStr('ONEMANAGER_CONFIG_SAVE_ENV') . '
' . getconstStr('Home') . '';
+ $title = 'Reinstall';
+ return message($html, $title, 201);
+ }
$html .= '