| @@ 305-313 (lines=9) @@ | ||
| 302 | * @return bool 复制成功返回 true,否则 false |
|
| 303 | * @throws \Exception |
|
| 304 | */ |
|
| 305 | public function copy($source, $target) |
|
| 306 | { |
|
| 307 | $source = '/' . $this->config->serviceName . '/' . ltrim($source, '/'); |
|
| 308 | $req = new Rest($this->config); |
|
| 309 | $response = $req->request('PUT', $target) |
|
| 310 | ->withHeader('X-Upyun-Copy-Source', $source) |
|
| 311 | ->send(); |
|
| 312 | return util::isSuccess($response->getStatusCode()); |
|
| 313 | } |
|
| 314 | ||
| 315 | /** |
|
| 316 | * 移动文件。可以进行文件重命名、文件移动,只能操作文件,不能操作文件夹。 |
|
| @@ 323-331 (lines=9) @@ | ||
| 320 | * @return bool 移动成功返回 true,否则 false |
|
| 321 | * @throws \Exception |
|
| 322 | */ |
|
| 323 | public function move($source, $target) |
|
| 324 | { |
|
| 325 | $source = '/' . $this->config->serviceName . '/' . ltrim($source, '/'); |
|
| 326 | $req = new Rest($this->config); |
|
| 327 | $response = $req->request('PUT', $target) |
|
| 328 | ->withHeader('X-Upyun-Move-Source', $source) |
|
| 329 | ->send(); |
|
| 330 | return util::isSuccess($response->getStatusCode()); |
|
| 331 | } |
|
| 332 | ||
| 333 | /** |
|
| 334 | * 刷新缓存 |
|