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

google storage support? #237

Closed
adamgyongyosi opened this issue Mar 23, 2021 · 8 comments
Closed

google storage support? #237

adamgyongyosi opened this issue Mar 23, 2021 · 8 comments
Milestone

Comments

@adamgyongyosi
Copy link

hy can you add google storage support?

@bytehead
Copy link
Member

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

@bytehead bytehead added this to the 4.x milestone Mar 23, 2021
@bytehead
Copy link
Member

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

@bytehead
Copy link
Member

Closing in favor of #238.

@bytehead
Copy link
Member

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

@adamgyongyosi
Copy link
Author

working on another project, I need more time

@adamgyongyosi
Copy link
Author

adamgyongyosi commented Mar 24, 2021

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
Copy link
Author

adamgyongyosi commented Mar 26, 2021

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
Copy link
Member

4.1.0 is released. Sorry for the waiting time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants