From 78194dd79eb6e7c9e9ee59de599365498f4dc533 Mon Sep 17 00:00:00 2001 From: Piotr Antosik Date: Mon, 14 Oct 2024 22:43:51 +0200 Subject: [PATCH 1/2] Use service injection in AsyncAwsS3Factory --- src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php b/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php index b40d948..be8ec4d 100644 --- a/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php +++ b/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php @@ -19,12 +19,14 @@ public function getKey(): string public function create(ContainerBuilder $container, string $id, array $config): void { + $visibilityConverter = $config['visibilityConverter'] ? new Reference($config['visibilityConverter']) : null; + $container ->setDefinition($id, new ChildDefinition('oneup_flysystem.adapter.async_aws_s3')) ->replaceArgument(0, new Reference($config['client'])) ->replaceArgument(1, $config['bucket']) ->replaceArgument(2, $config['prefix']) - ->replaceArgument(3, $config['visibilityConverter']) + ->replaceArgument(3, $visibilityConverter) ; } From 4cd160108d760322d7d7994b90b3ea717d2f14be Mon Sep 17 00:00:00 2001 From: Piotr Antosik Date: Mon, 14 Oct 2024 22:47:38 +0200 Subject: [PATCH 2/2] Add doc about visibility converter --- doc/adapter_async_aws_s3.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/adapter_async_aws_s3.md b/doc/adapter_async_aws_s3.md index c92cd64..f8c31a7 100644 --- a/doc/adapter_async_aws_s3.md +++ b/doc/adapter_async_aws_s3.md @@ -7,6 +7,9 @@ the S3 client at [async-aws.com](https://async-aws.com/clients/) or use the ```yml services: + acme.async.portable_visibility_converter: + class: League\Flysystem\AsyncAwsS3\PortableVisibilityConverter: + acme.async_s3_client: class: AsyncAws\S3\S3Client arguments: @@ -25,6 +28,8 @@ oneup_flysystem: client: acme.async_s3_client bucket: 'my_image_bucket' prefix: '' + visibilityConverter: acme.async.portable_visibility_converter + ``` ## More to know