From a96c17fe4511daf137cadbc86d5d84bc073b920d Mon Sep 17 00:00:00 2001 From: qcminecraft <qcmc@qcminecraft.com> Date: Thu, 7 May 2020 09:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=E4=BF=AE=E5=A4=8D=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danmaku.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/danmaku.php b/danmaku.php index 1abbcada..5800a893 100644 --- a/danmaku.php +++ b/danmaku.php @@ -19,12 +19,14 @@ //敏感词 function aword($str){ + global $appid, $secret_id, $secret_key; if(!$str){ return false; } - if(getenv('CMS')){ + if(getenv('CMS') == "true"){ try { - echo "CMS Ready \n"; + echo "CMS Log: \n"; + var_dump($secret_id); $cred = new Credential($secret_id, $secret_key); $httpProfile = new HttpProfile(); $httpProfile->setEndpoint("cms.tencentcloudapi.com"); @@ -46,6 +48,7 @@ function aword($str){ var_dump($result); } catch(TencentCloudSDKException $e) { + echo "CMS Error:\n"; echo $e; } if($result->Data->EvilFlag) @@ -63,9 +66,9 @@ function aword($str){ } function main_handler($event, $context) { - print "start main handler\n"; + print "Event info:\n"; print_r($event); - global $appid; + global $appid, $secret_id, $secret_key; global $cosClient; global $bucket; global $origin; @@ -91,6 +94,7 @@ function main_handler($event, $context) { $bucket = "danmaku-".$appid; //存储桶名称 格式:BucketName-APPID $result = $cosClient->createBucket(array('Bucket' => $bucket)); //请求成功 + echo "Bucket Create:\n"; print_r($result); } catch (\Exception $e) { //请求失败 @@ -145,6 +149,7 @@ function main_handler($event, $context) { 'Body' => fopen("/".$key, 'rb'), )); // 请求成功 + echo "File upload: \n"; print_r($result); // $this->versionId = $result['VersionId']; return $danmaku; @@ -172,7 +177,8 @@ function main_handler($event, $context) { 'Key' => "data/".$body->id.".json", 'Body' => fopen("/".$key, 'rb'), )); - // 请求成功 + // 请求成功 + echo "File upload: \n"; print_r($result); return $danmaku; } catch (\Exception $e) {