Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncAWS - visibilityConverter should be a service #308

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/adapter_async_aws_s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;
}

Expand Down