| @@ 190-201 (lines=12) @@ | ||
| 187 | * @param string $folder 目录路径 |
|
| 188 | * 注意不能删除bucket下根目录/ |
|
| 189 | */ |
|
| 190 | public static function delFolder($bucket, $folder) |
|
| 191 | { |
|
| 192 | if (empty($bucket) || empty($folder)) { |
|
| 193 | return [ |
|
| 194 | 'code' => ErrorCode::COSAPI_PARAMS_ERROR, |
|
| 195 | 'message' => 'bucket or path is empty', ]; |
|
| 196 | } |
|
| 197 | ||
| 198 | $folder = self::normalizerPath($folder, true); |
|
| 199 | ||
| 200 | return self::delBase($bucket, $folder); |
|
| 201 | } |
|
| 202 | ||
| 203 | /* |
|
| 204 | * 更新文件 |
|
| @@ 240-251 (lines=12) @@ | ||
| 237 | * @param string $bucket |
|
| 238 | * @param string $path 文件路径 |
|
| 239 | */ |
|
| 240 | public static function delFile($bucket, $path) |
|
| 241 | { |
|
| 242 | if (empty($bucket) || empty($path)) { |
|
| 243 | return [ |
|
| 244 | 'code' => ErrorCode::COSAPI_PARAMS_ERROR, |
|
| 245 | 'message' => 'path is empty', ]; |
|
| 246 | } |
|
| 247 | ||
| 248 | $path = self::normalizerPath($path); |
|
| 249 | ||
| 250 | return self::delBase($bucket, $path); |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * 内部方法, 上传文件. |
|