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) {