Skip to content

Commit

Permalink
支持多种过期时间格式
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Nov 15, 2023
1 parent e13ca0b commit c5a1a14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"require": {
"php": ">=8.0.2",
"league/flysystem": "^3.0",
"overtrue/qcloud-cos-client": "^2.0"
"overtrue/qcloud-cos-client": "^2.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
6 changes: 2 additions & 4 deletions src/CosAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ public function getUrl(string $path): string

/**
* For laravel FilesystemAdapter.
*
* @throws \Overtrue\CosClient\Exceptions\InvalidConfigException
*/
public function getTemporaryUrl($path, int|string|\DateTimeInterface $expiration): string
{
Expand All @@ -341,10 +343,6 @@ public function getSignedUrl(string $path, int|string $expires = '+60 minutes'):
{
$prefixedPath = $this->prefixer->prefixPath($path);

if (is_int($expires)) {
$expires = \date('Y-m-d H:i:s', $expires);
}

return $this->getObjectClient()->getObjectSignedUrl($prefixedPath, $expires);
}

Expand Down

0 comments on commit c5a1a14

Please sign in to comment.