johnlui / AliyunOSS-Laravel7

阿里云 OSS 官方 SDK 的 Composer 封装,专门支持 Laravel 7、Laravel 8
33 stars 5 forks source link

laravel8有没有? #1

Open 9oudan opened 3 years ago

9oudan commented 3 years ago

当前版本兼容laravel8吗?

johnlui commented 3 years ago

兼容,我正在用

Jack718 commented 2 years ago

[previous exception] [object] (Guzzle\Common\Exception\InvalidArgumentException(code: 0): Invalid handle provided at /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlHandle.php:224) [stacktrace]

0 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlHandle.php(210): Guzzle\Http\Curl\CurlHandle->__construct(Object(CurlHandle), Array)

1 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(182): Guzzle\Http\Curl\CurlHandle::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest))

2 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(159): Guzzle\Http\Curl\CurlMulti->createCurlHandle(Object(Guzzle\Http\Message\EntityEnclosingRequest))

3 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(65): Guzzle\Http\Curl\CurlMulti->beforeSend(Object(Guzzle\Http\Message\EntityEnclosingRequest))

4 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMultiProxy.php(88): Guzzle\Http\Curl\CurlMulti->add(Object(Guzzle\Http\Message\EntityEnclosingRequest))

5 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Client.php(282): Guzzle\Http\Curl\CurlMultiProxy->send()

6 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/libs/guzzle/http/Guzzle/Http/Message/Request.php(198): Guzzle\Http\Client->send(Object(Guzzle\Http\Message\EntityEnclosingRequest))

7 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/Common/Communication/HttpServiceClient.php(57): Guzzle\Http\Message\Request->send()

8 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/Common/Communication/OpenServiceClient.php(37): Aliyun\Common\Communication\HttpServiceClient->sendRequest(Object(Aliyun\Common\Communication\HttpRequest), Object(Aliyun\Common\Communication\ExecutionContext))

9 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/Common/Communication/RetryableServiceClient.php(32): Aliyun\Common\Communication\OpenServiceClient->sendRequest(Object(Aliyun\Common\Communication\HttpRequest), Object(Aliyun\Common\Communication\ExecutionContext))

10 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/Common/Communication/RetryableServiceClient.php(27): Aliyun\Common\Communication\RetryableServiceClient->sendRequestImpl(Object(Aliyun\Common\Communication\HttpRequest), Object(Aliyun\Common\Communication\ExecutionContext), 0)

11 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/Common/Communication/Command.php(121): Aliyun\Common\Communication\RetryableServiceClient->sendRequest(Object(Aliyun\Common\Communication\HttpRequest), Object(Aliyun\Common\Communication\ExecutionContext))

12 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/OSS/OSSClient.php(430): Aliyun\Common\Communication\Command->execute(Array, Array)

13 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/oss/src/Aliyun/OSS/OSSClient.php(154): Aliyun\OSS\OSSClient->execute('putObject', Array)

14 /Users/asher/Code/decathlon_server/vendor/johnlui/aliyun-oss-laravel7/src/AliyunOSS.php(101): Aliyun\OSS\OSSClient->putObject(Array)

15 /Users/asher/Code/decathlon_server/app/Http/Services/Utils/OSSService.php(49): JohnLui\AliyunOSS->uploadFile('164191038494.jp...', '/private/var/tm...', Array)

16 /Users/asher/Code/decathlon_server/app/Http/Services/Billing/PostService.php(139): App\Http\Services\Utils\OSSService::publicUpload('api-step', '164191038494.jp...', '/private/var/tm...', Array)

17 /Users/asher/Code/decathlon_server/app/Http/Controllers/Billing/PostAPIController.php(65): App\Http\Services\Billing\PostService->uploadOss(Object(Illuminate\Http\Request))

18 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Billing\PostAPIController->uploadOss(Object(Illuminate\Http\Request))

19 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('uploadOss', Array)

20 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Billing\PostAPIController), 'uploadOss')

21 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()

22 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()

23 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

24 /Users/asher/Code/decathlon_server/app/Http/Middleware/CrossHttp.php(17): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

25 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CrossHttp->handle(Object(Illuminate\Http\Request), Object(Closure))

26 /Users/asher/Code/decathlon_server/app/Http/Middleware/ResponseTransFormMiddleware.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

27 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\ResponseTransFormMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))

28 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

29 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then(Object(Closure))

30 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))

31 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))

32 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))

33 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))

34 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))

35 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

36 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))

37 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))

38 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

39 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))

40 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))

41 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

42 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))

43 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

44 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))

45 /Users/asher/Code/decathlon_server/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

46 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))

47 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

48 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))

49 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

50 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))

51 /Users/asher/Code/decathlon_server/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

52 /Users/asher/Code/decathlon_server/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

53 {main}

"}

Jack718 commented 2 years ago

大佬,这是php8的问题吗

mchobits commented 2 years ago

大佬,这是php8的问题吗

今天我也是这个问题,debug以后发现是johnlui/aliyun-oss-laravel7这个包里面用到的guzzle包版本太低,而php8.0以后的curl_init方法返回变成对象了,is_resource函数判断返回一直为false导致的.....只能fork那个包改或者等这个包换依赖了...

lipichang commented 1 year ago

大佬,这是php8的问题吗

今天我也是这个问题,debug以后发现是johnlui/aliyun-oss-laravel7这个包里面用到的guzzle包版本太低,而php8.0以后的curl_init方法返回变成对象了,is_resource函数判断返回一直为false导致的.....只能fork那个包改或者等这个包换依赖了...

也遇到了