Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Jul 7, 2021
1 parent 05a3216 commit 4f4d8a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions src/CosAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand All @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 4f4d8a8

Please sign in to comment.