websightgmbh / l5-google-cloud-storage

Laravel 5 Flysystem Adapter for Google Cloud Storage
MIT License
36 stars 17 forks source link

Using credentials through optionalServiceBuilder fails #12

Open guntars opened 7 years ago

guntars commented 7 years ago

When using the provider with json credentials, it fails because GoogleCloudStorageAdaptor requires StorageClient as first param, but ServiceBuilder is given instead.

When adding the config to $adapterConfiguration like in case of project_id and leaving $optionalServiceBuilder as null, then it works just fine.

I think the references to optionalServiceBuilder can be entirely left out, because they don't seem to do anything.

jcespinosa commented 7 years ago

Maybe is a little bit late, but, is better to write your own service provider and use the Google Cloud Storage Adapter of the same author (https://github.com/cedricziel/flysystem-gcs). The short way is to copy the contents of src/Websight/GcsProvider/CloudStorageServiceProvider, paste on your own service provider, tune it and add it to your application instead of Websight\GcsProvider\CloudStorageServiceProvider