From 268c6e8be78e33ea694116e6359f54f6b9617753 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 8 Aug 2020 11:19:10 +0800 Subject: [PATCH] FG:select save in env or file --- index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index cd6fa0c..98aef13 100644 --- a/index.php +++ b/index.php @@ -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); + } }