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; 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; 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; } 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; }