flysystem-aws-s3-v3
flysystem-aws-s3-v3 copied to clipboard
Fstat returns false with 1.0.26 version
I have a piece of code like this:
$resource = $this->storage->readStream((string)$path);
if (is_resource($resource)) {
$resourceData = stream_get_contents($resource);
$resourceProperties = fstat($resource);
...
With flysystem-aws-s3-v3 1.0.25 fstat returns an array with size
If I upgrade to 1.0.26 fstat return false instead...
My configuration:
flysystem:
storages:
default.storage:
adapter: 'custom.awss3adapter'
And my custom awss3adapter
use Aws\S3\MultipartUploader;
use Aws\S3\S3Client;
use Exception;
use League\Flysystem\AdapterInterface;
use League\Flysystem\AwsS3v3\AwsS3Adapter as BaseAwsS3Adapter;
final class AwsAdapter extends BaseAwsS3Adapter
{
public const DEFAULT_CONCURRENCY = 10;
public const DEFAULT_MULTIPART_THRESHOLD = 209715200;
public const DEFAULT_PART_SIZE = 1073741824;
public function __construct(S3Client $client, $bucket, $prefix = '', array $options = [])
{
parent::__construct($client, $bucket, $prefix, $options);
}
}
After some investigation the problem is there:
if ($stream) {
$options['@http']['stream'] = true;
}
This piece was added on 1.0.26 https://github.com/thephpleague/flysystem-aws-s3-v3/commit/9aff157a3ae4bb5df93728f940737263ba6108d7
I can confirm the breaking of the fstat and by removing the line stream = true line it works again.
@rarothedude any update on that?