diff --git a/README.md b/README.md index f17b854..d4c081d 100644 --- a/README.md +++ b/README.md @@ -67,29 +67,23 @@ bool $flysystem->write('file.md', 'http://httpbin.org/robots.txt', ['mime' => 'a bool $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r')); -bool $flysystem->update('file.md', 'new contents'); - -bool $flysystem->updateStream('file.md', fopen('path/to/your/local/file.jpg', 'r')); - -bool $flysystem->rename('foo.md', 'bar.md'); +bool $flysystem->move('foo.md', 'bar.md'); bool $flysystem->copy('foo.md', 'foo2.md'); bool $flysystem->delete('file.md'); -bool $flysystem->has('file.md'); +bool $flysystem->fileExists('file.md'); string|mixed|false $flysystem->read('file.md'); array $flysystem->listContents(); -array|false $flysystem->getMetadata('file.md'); - -int $flysystem->getSize('file.md'); +int $flysystem->fileSize('file.md'); -string $flysystem->getMimetype('file.md'); +string $flysystem->mimeType('file.md'); -int $flysystem->getTimestamp('file.md'); +int $flysystem->lastModified('file.md'); // 插件提供的方法 string $flysystem->getUrl('foo.md'); diff --git a/src/CosAdapter.php b/src/CosAdapter.php index 93b55cd..1d1273c 100644 --- a/src/CosAdapter.php +++ b/src/CosAdapter.php @@ -111,7 +111,7 @@ public function read(string $path): string public function move(string $source, string $destination, Config $config): void { - $this->copy($source, $destination); + $this->copy($source, $destination, $config); $this->delete($this->prefixer->prefixPath($source)); } @@ -122,7 +122,7 @@ public function copy(string $source, string $destination, Config $config): void $location = $this->getSourcePath($prefixedSource); - $prefixedDestination = $this->applyPathPrefix($destination); + $prefixedDestination = $this->prefixer->prefixPath($destination); $response = $this->getObjectClient()->copyObject( $prefixedDestination, @@ -143,7 +143,7 @@ public function delete(string $path): void if (!$response->isSuccessful()) { throw UnableToDeleteFile::atLocation($path, (string)$response->getBody()); - }; + } } public function listContents(string $path, bool $deep): iterable