Coder Social home page Coder Social logo

flysystem-cos's Introduction

flysystem-cos's People

Contributors

lddtime avatar limingxinleo avatar overtrue avatar ramzeng avatar russellxrs avatar summerblue avatar sy-records avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flysystem-cos's Issues

listObjects 方法获取失败

image

在测试获取目录的时候,发现无论传什么参数都返回空数组。检查代码的时,发现了此问题。

接口返回的xml结果最外层是使用 ListBucketResult 来包含的,但通过xml2arr 后,则已经没有了这一层

不能在PHP8.1中使用

如题:
Deprecated: Return type of Overtrue\CosClient\Config::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/discuss/vendor/overtrue/qcloud-cos-client/src/Config.php on line 92

Deprecated: Return type of Overtrue\CosClient\Config::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/discuss/vendor/overtrue/qcloud-cos-client/src/Config.php on line 97

还有该文件的102,107行以及src/Http/Response.php的48,57.62,67,72行

虽然是Deprecated,但是还是希望作者能够适配下

visibility 方法有问题

image

如图,这个地方获取acl权限,但是实际上腾讯云返回的都是xml格式,这个地方使用数组循环,肯定都是空
所以权限永远是private,导致livewire生成的地址也都是私有带签名的地址,
image

league/flysystem与Thinkphp8.0里的冲突。安装不了

Using version ^5.1 for overtrue/flysystem-cos
./composer.json has been updated
Running composer update overtrue/flysystem-cos
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- overtrue/flysystem-cos[5.1.0, ..., 5.1.8] require league/flysystem ^3.0 -> found league/flysystem[3.0.0, ..., 3.24.0] but the package is fixed to 2.5.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires overtrue/flysystem-cos ^5.1 -> satisfiable by overtrue/flysystem-cos[5.1.0, ..., 5.1.8].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require overtrue/flysystem-cos:*" to figure out if any version is installable, or "composer require overtrue/flysystem-cos:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

上传超过1M文件

cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for

上传超过1M的文件出现这个

使用的框架是hyperf

上传到服务器本地是没有问题的而且上传小文件也是没有问题的

swoole和php.ini的post配置也是改了的

上传超过1M的文件

cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for

上传超过1M的文件出现这个

使用的框架是hyperf

上传到服务器本地是没有问题的而且上传小文件也是没有问题的

swoole和php.ini的post配置也是改了的
本地上传 50M没问题. 手动上传腾讯云 50M也没有问题, 但是通过/overtrue/flysystem-cos用腾讯云就只能 1M
原来的 issues没有解决,请问有哪里可以设置的地址吗

v3版本的SDK能否升级为2.0

V3.0.2版本的SDK为1.0不支持8.1的版本!
TP6他的league/flysystem只能1.0,所以没办法只能用V3.0.2版本。谢谢

During inheritance of ArrayAccess: Uncaught think\exception\ErrorException: Return type of Overtrue\CosClient\Config::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/tiger/vendor/overtrue/qcloud-cos-client/src/Config.php:92
Stack trace:
#0 /var/www/html/tiger/vendor/overtrue/qcloud-cos-client/src/Config.php(9): think\initializer\Error->appError()
#1 /var/www/html/tiger/vendor/composer/ClassLoader.php(571): include('/var/www/html/t...')
#2 /var/www/html/tiger/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /var/www/html/tiger/vendor/overtrue/qcloud-cos-client/src/ObjectClient.php(23): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/tiger/vendor/overtrue/flysystem-cos/src/CosAdapter.php(352): Overtrue\CosClient\ObjectClient->__construct()
#5 /var/www/html/tiger/vendor/overtrue/flysystem-cos/src/CosAdapter.php(67): Overtrue\Flysystem\Cos\CosAdapter->getObjectClient()
#6 /var/www/html/tiger/vendor/overtrue/flysystem-cos/src/CosAdapter.php(93): Overtrue\Flysystem\Cos\CosAdapter->write()
#7 /var/www/html/tiger/vendor/league/flysystem/src/Filesystem.php(123): Overtrue\Flysystem\Cos\CosAdapter->writeStream()
#8 /var/www/html/tiger/vendor/topthink/framework/src/think/filesystem/Driver.php(142): League\Flysystem\Filesystem->putStream()
#9 /var/www/html/tiger/vendor/topthink/framework/src/think/filesystem/Driver.php(131): think\filesystem\Driver->__call()
#10 /var/www/html/tiger/app/controller/Index.php(14): think\filesystem\Driver->putFileAs()
#11 [internal function]: app\controller\Index->index()
#12 /var/www/html/tiger/vendor/topthink/framework/src/think/Container.php(344): ReflectionMethod->invokeArgs()
#13 /var/www/html/tiger/vendor/topthink/framework/src/think/route/dispatch/Controller.php(110): think\Container->invokeReflectMethod()
#14 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(59): think\route\dispatch\Controller->think\route\dispatch\{closure}()
#15 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#16 /var/www/html/tiger/vendor/topthink/framework/src/think/route/dispatch/Controller.php(113): think\Pipeline->then()
#17 /var/www/html/tiger/vendor/topthink/framework/src/think/route/Dispatch.php(90): think\route\dispatch\Controller->exec()
#18 /var/www/html/tiger/vendor/topthink/framework/src/think/Route.php(785): think\route\Dispatch->run()
#19 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(59): think\Route->think\{closure}()
#20 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#21 /var/www/html/tiger/vendor/topthink/framework/src/think/Route.php(786): think\Pipeline->then()
#22 /var/www/html/tiger/vendor/topthink/framework/src/think/Http.php(216): think\Route->dispatch()
#23 /var/www/html/tiger/vendor/topthink/framework/src/think/Http.php(206): think\Http->dispatchToRoute()
#24 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(59): think\Http->think\{closure}()
#25 /var/www/html/tiger/vendor/topthink/think-trace/src/TraceDebug.php(71): think\Pipeline->think\{closure}()
#26 [internal function]: think\trace\TraceDebug->handle()
#27 /var/www/html/tiger/vendor/topthink/framework/src/think/Middleware.php(142): call_user_func()
#28 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(85): think\Middleware->think\{closure}()
#29 /var/www/html/tiger/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#30 /var/www/html/tiger/vendor/topthink/framework/src/think/Http.php(207): think\Pipeline->then()
#31 /var/www/html/tiger/vendor/topthink/framework/src/think/Http.php(170): think\Http->runWithRequest()
#32 /var/www/html/tiger/public/index.php(20): think\Http->run()
#33 {main}

getUploadOptions 方法语法错误

getUploadOptions 方法中获取 $config 的语法错误,因为 Config 没有实现 ArrayAccess 接口,所以不能用数组的方式取值

v3 版本的 getUrl 方法会进行一次性 rawurlencode

如题,v3 版本的 getUrl 会对 path 进行一次 rawurlencode 编码(v2版本不会编码),这样在 key 是中文的情况下会存在问题,举例如下:

$path = 'foo/bar/这个是中文的文件名.txt';
$filesystem->write($path, 'test content');

$url = $filesystem->getUrl($path);

Model::create([
    'url' => $url
]);

如以上的例子,getUrl 返回的是编码后的 url,假如这时候直接入库,那么保存到数据库中的已经是被编码过了,访问上不影响,但是业务上是不能接受的

由于云存储本身都是支持中文 key 的,所以这里不应该做一次 rawurlencode 编码,而应该原样返回,具体要不要 rawurlencode 交给开发者自行处理

v3 版本的 getUrl 方法会进行一次性 rawurlencode

如题,v3 版本的 getUrl 会对 path 进行一次 rawurlencode 编码(v2版本不会编码),这样在 key 是中文的情况下会存在问题,举例如下:

$path = 'foo/bar/这个是中文的文件名.txt';
$filesystem->write($path, 'test content');

$url = $filesystem->getUrl($path);

Model::create([
    'url' => $url
]);

如以上的例子,getUrl 返回的是编码后的 url,假如这时候直接入库,那么保存到数据库中的已经是被编码过了,访问上不影响,但是业务上是不能接受的

由于云存储本身都是支持中文 key 的,所以这里不应该做一次 rawurlencode 编码,而应该原样返回,具体要不要 rawurlencode 交给开发者自行处理

当目录下只有一个文件时报错

Argument 1 passed to Overtrue\Flysystem\Cos\CosAdapter::normalizeFileInfo() must be of the type array, string given, called in /Users/eslizn/go/src/github.com/eslizn/kaelthas/vendor/overtrue/flysystem-cos/src/CosAdapter.php on line 186

调试发现只有一个文件时$response['Contents']返回的是一维数组而非二维数组

fileExists()文件不存在会抛出异常

若文件不存在,请求的状态码为404, Guzzle抛出异常

qcloud-cos-client/src/Client.php中也直接抛出异常

fileExists()getMetadata()都没处理该异常

    // qcloud-cos-client/src/Client.php

    public function __call($method, $arguments)
    {
        try {
            return new Response(\call_user_func_array([$this->getHttpClient(), $method], $arguments));
        } catch (\GuzzleHttp\Exception\ClientException $e) {
            // 文件不存在这里直接抛出了异常
            throw new ClientException($e);
        } catch (\GuzzleHttp\Exception\ServerException $e) {
            throw new ServerException($e);
        } catch (\Throwable $e) {
            throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious());
        }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.