1up-lab / OneupFlysystemBundle

A Flysystem integration for your Symfony projects.
MIT License
635 stars 118 forks source link

google storage support? #237

Closed adamgyongyosi closed 3 years ago

adamgyongyosi commented 3 years ago

hy can you add google storage support?

bytehead commented 3 years ago

It's not available yet for flysystem v2. You can use version 3.x of this bundle instead.

bytehead commented 3 years ago

I've just spotted the adapter in the GitHub repo of flysystem (just missing in the docs). I'll add it 👍

bytehead commented 3 years ago

Closing in favor of #238.

bytehead commented 3 years ago

Can you test the branch feature/google-cloud-storage? :)

adamgyongyosi commented 3 years ago

working on another project, I need more time

adamgyongyosi commented 3 years ago

config/packages/oneup_flysystem.yaml

oneup_flysystem:
    adapters:
        public_uploads_adapter3:
            googlecloudstorage:
                bucket: "xxxx.appspot.com"
    filesystems:
        public_uploads_filesystem3:
            adapter: public_uploads_adapter3

image

can you help me pls?

adamgyongyosi commented 3 years ago

config/packages/oneup_flysystem.yaml

oneup_flysystem:
    adapters:
        public_uploads_adapter4:
            custom:
                service: flysystem.adapter.default.storage
    filesystems:
        public_uploads_filesystem4:
            adapter: public_uploads_adapter4

config/packages/dev/flysystem.yaml

flysystem:
    storages:
        default.storage:
            adapter: 'gcloud'
            options:
                client: 'gcloud_client_service' # The service ID of the Google\Cloud\Storage\StorageClient instance
                bucket: '%env(GOOGLE_CLOUD_STORAGE_BUCKET)%'

config/services.yaml

...
    gcloud_client_service:
        class: Google\Cloud\Storage\StorageClient
        arguments:
            - keyFilePath: '%env(GOOGLE_APPLICATION_CREDENTIALS)%'
...

config/packages/liip_imagine.yaml

liip_imagine:
    #    # valid drivers options include "gd" or "gmagick" or "imagick"
    #    driver: "gd"
    #
    webp:
        generate: true
    controller:
        redirect_response_code: 302
    loaders:
        flysystem_loader:
            flysystem:
                filesystem_service: oneup_flysystem.public_uploads_filesystem4_filesystem
    # default loader to use for all filter sets
    data_loader: flysystem_loader
    resolvers:
        flysystem_resolver:
            flysystem:
                filesystem_service: oneup_flysystem.public_uploads_filesystem4_filesystem
                cache_prefix: media/cache
                root_url: 'https://google.storage.cdn.xxx.xxx.com/'
                visibility: public
    # default cache resolver for saving thumbnails
    cache: flysystem_resolver
    filter_sets:
        squared_thumbnail_medium:
            filters:
                thumbnail:
                    size:          [500, 500]
                    mode:          outbound
                    allow_upscale: true

image image

@bytehead can you check my config? and help me how to do 'googlecloudstorage' adatpter

bytehead commented 3 years ago

4.1.0 is released. Sorry for the waiting time.