FG:select save in env or file

This commit is contained in:
qkqpttgf 2020-08-08 11:19:10 +08:00 committed by GitHub
parent 3619a611a7
commit 268c6e8be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -11,7 +11,9 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
} elseif (isset($_SERVER['FC_SERVER_PATH'])&&$_SERVER['FC_SERVER_PATH']==='/var/fc/runtime/php7.2') {
include 'platform/AliyunFC.php';
} elseif ($_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') {
include 'platform/HuaweiFG.php';
//if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/HuaweiFG_file.php';
//else include 'platform/HuaweiFG_env.php';
echo 'FG' . PHP_EOL;
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
include 'platform/Heroku.php';
$path = getpath();
@ -91,6 +93,9 @@ function handler($event, $context)
// Huawei FG
global $contextUserData;
$contextUserData = $context;
if ($context->getUserData('ONEMANAGER_CONFIG_SAVE')=='file') include_once 'platform/HuaweiFG_file.php';
else include_once 'platform/HuaweiFG_env.php';
$event = json_decode(json_encode($event), true);
if ($event['isBase64Encoded']) $event['body'] = base64_decode($event['body']);
@ -104,6 +109,7 @@ function handler($event, $context)
$path = GetPathSetting($event, $context);
return main($path);
}
}