LiipImagineBundle icon indicating copy to clipboard operation
LiipImagineBundle copied to clipboard

add deprecation note.

Open tacman opened this issue 1 year ago • 4 comments

Having both amazon-s3 and aws-s3 is confusing.

tacman avatar Jan 06 '24 13:01 tacman

Coverage Status

coverage: 82.018% (+0.02%) from 81.998% when pulling aad39cdf6b646d63d11b0a1eeee24ccf923bfe31 on tacman:patch-2 into 1d42ed1edb41a64514a287c7ea6c4d895b0220dc on liip:2.x.

coveralls avatar Jan 06 '24 13:01 coveralls

do we need an S3 resolver at all in version 3? or could we do all with flysystem? or can flysystem not provide the web URL to a file on S3?

dbu avatar Jan 06 '24 16:01 dbu

Hmm, interesting question. Regardless, we need more documentation and examples.

This is what I use for s3 on production and local filesystem in dev.

# config/packages/flysystem.yaml
# Read the documentation at https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md
flysystem:
    storages:
        default.storage:
            adapter: 'aws'
            # visibility: public # Make the uploaded file publicly accessible in S3
            options:
                client: 'Aws\S3\S3Client' # The service ID of the Aws\S3\S3Client instance
                bucket: '%env(AWS_S3_BUCKET_NAME)%'
                streamReads: true
                prefix: '%env(S3_STORAGE_PREFIX)%'
when@dev:
    flysystem:
        storages:
            default.storage:
                adapter: 'local'
                options:
                    directory: '%kernel.project_dir%/public/images'

And

# config/packages/liip_imagine.yamn
liip_imagine:
    driver: "gd"
    twig:
        mode: lazy

    loaders:
        flysystem_loader:
            flysystem:
                # this comes from flysystem.yaml
                filesystem_service: default.storage

    # default loader to use for all filter sets
    data_loader: flysystem_loader

tacman avatar Jan 06 '24 18:01 tacman

looks like modern versions of flysystem actually support that: https://flysystem.thephpleague.com/docs/usage/public-urls/

i think the way to go for 3.x is to leverage flysystem as much as we can to avoid this bundle having to care about storage and filesystem and such stuff.

dbu avatar Jan 12 '24 10:01 dbu