From 3259eb1db25147e0e50a45f9edc0445192b50c97 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 3 Jun 2020 14:08:50 +0800 Subject: [PATCH] Update alifc.php --- platform/alifc.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/platform/alifc.php b/platform/alifc.php index 9b9d5af..b0b2005 100644 --- a/platform/alifc.php +++ b/platform/alifc.php @@ -247,12 +247,12 @@ function updateEnvironment($Envs, $accountId, $region, $service_name, $function_ $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值 ksort($tmp_env); - $tmpdata['functionName'] = $function_name; - $tmpdata['description'] = 'Onedrive index and manager in Ali FC.'; - $tmpdata['memorySize'] = 128; - $tmpdata['timeout'] = 30; - $tmpdata['runtime'] = 'php7.2'; - $tmpdata['handler'] = 'index.handler'; + $tmpdata['functionName'] = $tmp['functionName']; + $tmpdata['description'] = $tmp['description']; + $tmpdata['memorySize'] = $tmp['memorySize']; + $tmpdata['timeout'] = $tmp['timeout']; + $tmpdata['runtime'] = $tmp['runtime']; + $tmpdata['handler'] = $tmp['handler']; $tmpdata['environmentVariables'] = $tmp_env; $tmpdata['code']['zipFile'] = base64_encode( file_get_contents($fcClient->getFunctionCode($service_name, $function_name)['data']['url']) ); return $fcClient->updateFunction($service_name, $function_name, $tmpdata); @@ -298,15 +298,15 @@ function updateProgram($accountId, $region, $service_name, $function_name, $Acce "accessKeySecret" => $AccessKeySecret ]); - $tmp_env = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']['environmentVariables']; + $tmp = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']; - $tmpdata['functionName'] = $function_name; - $tmpdata['description'] = 'Onedrive index and manager in Ali FC.'; - $tmpdata['memorySize'] = 128; - $tmpdata['timeout'] = 30; - $tmpdata['runtime'] = 'php7.2'; - $tmpdata['handler'] = 'index.handler'; - $tmpdata['environmentVariables'] = $tmp_env; + $tmpdata['functionName'] = $tmp['functionName']; + $tmpdata['description'] = $tmp['description']; + $tmpdata['memorySize'] = $tmp['memorySize']; + $tmpdata['timeout'] = $tmp['timeout']; + $tmpdata['runtime'] = $tmp['runtime']; + $tmpdata['handler'] = $tmp['handler']; + $tmpdata['environmentVariables'] = $tmp['environmentVariables']; $tmpdata['code']['zipFile'] = base64_encode( file_get_contents($source) ); return $fcClient->updateFunction($service_name, $function_name, $tmpdata); @@ -336,7 +336,7 @@ function setConfigResponse($response) function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master') { $source = '/tmp/code.zip'; - $outPath = "/tmp/"; + $outPath = '/tmp/'; // 从github下载对应tar.gz,并解压 $url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/';