Gaufrette icon indicating copy to clipboard operation
Gaufrette copied to clipboard

$file->getContent() return a StreamInterface instead of a String with GoogleCloudStorage adapter

Open laurentdabbb opened this issue 2 years ago • 3 comments

Hi,

I use Gaufrette with GoogleCloudStorage adapter in production and local filesystem in development and I observe differences on the returned type of getContent() method of File object.

getContent calls Filesystem->read() which calls adaptater read() method.

Returned type of File->getContent() should be a string. But, with GoogleCloudStorage adapter, the read() method return a StreamInterface ($response->getBody()) when Google_Http_Request does not exist (view here).

I suppose this line should be fixed with $response->getBody()->getContents()

Thx in advance.

laurentdabbb avatar Jan 17 '22 08:01 laurentdabbb

Hi,

Please consider this issue. I can provide some clarification if you have any questions.

Thx.

laurentdabbb avatar Apr 12 '22 13:04 laurentdabbb

Hello.

Thanks for trying to report an issue.

I never used the GoogleCloudStorage adapter. May the issue you encounter be related to a new version of guzzle or the google library?

In any case, PR are welcome to provide any fix. Please also consider using your own adapter instead of the one provided in this library that may be a little outdated.

Nek- avatar May 09 '22 21:05 Nek-

Hi @laurentdabbb. Is this issue is still relevant ?

As Nek mentioned, a pr is welcome to fix it.

KevinArtus avatar Apr 13 '23 14:04 KevinArtus