From 0c2a88d0403a67a980a929271e1ccd91182df8d3 Mon Sep 17 00:00:00 2001 From: "delex.xie" Date: Mon, 18 May 2020 16:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Elistobjects=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v1/demo/listobjects.php | 26 ++++++++++++++++++++++++++ v1/ucloud/conf.php | 4 ++-- v1/ucloud/proxy.php | 20 ++++++++++++++++++++ v1/ucloud/utils.php | 2 ++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 v1/demo/listobjects.php diff --git a/v1/demo/listobjects.php b/v1/demo/listobjects.php new file mode 100644 index 0000000..688a8ed --- /dev/null +++ b/v1/demo/listobjects.php @@ -0,0 +1,26 @@ +ErrMsg . "\n"; + echo "code: " . $err->Code . "\n"; + exit; +} + +echo json_encode($data, 128); diff --git a/v1/ucloud/conf.php b/v1/ucloud/conf.php index 73d263e..00e5c72 100644 --- a/v1/ucloud/conf.php +++ b/v1/ucloud/conf.php @@ -1,11 +1,11 @@ -$host, 'path'=>$path), null, $bucket, null, $action_type); + $req->Header['Content-Type'] = 'application/x-www-form-urlencoded'; + + $client = new UCloud_AuthHttpClient(null); + list($data, $err) = UCloud_Client_Call($client, $req); + return array($data, $err); +} //------------------------------生成公有文件Url------------------------------ // @results: $url diff --git a/v1/ucloud/utils.php b/v1/ucloud/utils.php index 05002e1..a785ecf 100644 --- a/v1/ucloud/utils.php +++ b/v1/ucloud/utils.php @@ -17,6 +17,7 @@ abstract class ActionType const UPLOADHIT = 7; const GETFILE = 8; const APPENDFILE = 9; + const LISTOBJECTS = 10; } class UCloud_Error @@ -125,6 +126,7 @@ function CheckConfig($action) { case ActionType::MFINISH: case ActionType::DELETE: case ActionType::UPLOADHIT: + case ActionType::LISTOBJECTS: if ($UCLOUD_PROXY_SUFFIX == "") { return new UCloud_Error(400, -1, "no proxy suffix found in config"); } else if ($UCLOUD_PUBLIC_KEY == "" || strstr($UCLOUD_PUBLIC_KEY, " ") != FALSE) {