From 3f7887dab5de063ff99c4047aaa2e6051087b54c Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:56:40 +0800 Subject: [PATCH 1/4] Update index.php --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 7b83647..a37587c 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { else include 'platform/TencentSCF_env.php'; } elseif (isset($_SERVER['FC_FUNC_CODE_PATH'])) { include 'platform/AliyunFC.php'; -} elseif (isset($_SERVER['_APP_SHARE_DIR']) && $_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') { +} elseif (isset($_SERVER['RUNTIME_LOG_PATH']) && $_SERVER['RUNTIME_LOG_PATH']=='/home/snuser/log') { //if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/HuaweiFG_file.php'; //else include 'platform/HuaweiFG_env.php'; echo 'FG' . PHP_EOL; @@ -134,7 +134,7 @@ function handler($event, $context) return new RingCentral\Psr7\Response($re['statusCode'], $re['headers'], ($re['isBase64Encoded']?base64_decode($re['body']):$re['body'])); - } elseif ($_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') { + } elseif (isset($_SERVER['RUNTIME_LOG_PATH']) && $_SERVER['RUNTIME_LOG_PATH']=='/home/snuser/log') { // Huawei FG global $contextUserData; $contextUserData = $context; From 813663b744d42e16c256dcdfe8caa6b47b9e77e2 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:59:15 +0800 Subject: [PATCH 2/4] Update common.php --- common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.php b/common.php index 256b282..9767cd7 100644 --- a/common.php +++ b/common.php @@ -1907,7 +1907,7 @@ output: $canOneKeyUpate = 1; } elseif (isset($_SERVER['BCE_CFC_RUNTIME_NAME'])&&$_SERVER['BCE_CFC_RUNTIME_NAME']=='php7') { $canOneKeyUpate = 1; - } elseif (isset($_SERVER['_APP_SHARE_DIR'])&&$_SERVER['_APP_SHARE_DIR']==='/var/share/CFF/processrouter') { + } elseif (isset($_SERVER['RUNTIME_LOG_PATH']) && $_SERVER['RUNTIME_LOG_PATH']=='/home/snuser/log') { $canOneKeyUpate = 1; } elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') { $canOneKeyUpate = 1; From 3de4f2bfde0962cd9f28585e2a0e326d3d8f0cf4 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 16 Apr 2023 17:07:29 +0800 Subject: [PATCH 3/4] Update HuaweiFG_env.php --- platform/HuaweiFG_env.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/HuaweiFG_env.php b/platform/HuaweiFG_env.php index 83d6451..f2ecf6b 100644 --- a/platform/HuaweiFG_env.php +++ b/platform/HuaweiFG_env.php @@ -6,7 +6,7 @@ global $contextUserData; function printInput($event, $context) { - $tmp['eventID'] = $context->geteventID(); + $tmp['RequestID'] = $context->getRequestID(); $tmp['RemainingTimeInMilliSeconds'] = $context->getRemainingTimeInMilliSeconds(); $tmp['AccessKey'] = $context->getAccessKey(); $tmp['SecretKey'] = $context->getSecretKey(); @@ -17,7 +17,7 @@ function printInput($event, $context) $tmp['MemorySize'] = $context->getMemorySize(); $tmp['CPUNumber'] = $context->getCPUNumber(); $tmp['ProjectID'] = $context->getProjectID(); - $tmp['Package'] = $context->Package(); + $tmp['Package'] = $context->getPackage(); $tmp['Token'] = $context->getToken(); $tmp['Logger'] = $context->getLogger(); @@ -75,7 +75,7 @@ function GetPathSetting($event, $context) $_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f' $_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since']; $_SERVER['REQUEST_METHOD'] = $event['httpMethod']; - $_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter'; + $_SERVER['RUNTIME_LOG_PATH'] = '/home/snuser/log'; return $path; } From cf6f59b7455d574a40b03730c09a526beb3d0ba8 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 16 Apr 2023 17:07:51 +0800 Subject: [PATCH 4/4] Update HuaweiFG_file.php --- platform/HuaweiFG_file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/HuaweiFG_file.php b/platform/HuaweiFG_file.php index 297bc10..df4e426 100644 --- a/platform/HuaweiFG_file.php +++ b/platform/HuaweiFG_file.php @@ -6,7 +6,7 @@ global $contextUserData; function printInput($event, $context) { - $tmp['eventID'] = $context->geteventID(); + $tmp['RequestID'] = $context->getRequestID(); $tmp['RemainingTimeInMilliSeconds'] = $context->getRemainingTimeInMilliSeconds(); $tmp['AccessKey'] = $context->getAccessKey(); $tmp['SecretKey'] = $context->getSecretKey(); @@ -17,7 +17,7 @@ function printInput($event, $context) $tmp['MemorySize'] = $context->getMemorySize(); $tmp['CPUNumber'] = $context->getCPUNumber(); $tmp['ProjectID'] = $context->getProjectID(); - $tmp['Package'] = $context->Package(); + $tmp['Package'] = $context->getPackage(); $tmp['Token'] = $context->getToken(); $tmp['Logger'] = $context->getLogger(); @@ -75,7 +75,7 @@ function GetPathSetting($event, $context) $_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f' $_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since']; $_SERVER['REQUEST_METHOD'] = $event['httpMethod']; - $_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter'; + $_SERVER['RUNTIME_LOG_PATH'] = '/home/snuser/log'; return $path; }