diff --git a/docs/2-cloud-storage-providers.md b/docs/2-cloud-storage-providers.md index 5c7486e..7a4e5d2 100644 --- a/docs/2-cloud-storage-providers.md +++ b/docs/2-cloud-storage-providers.md @@ -10,6 +10,7 @@ cloud providers by providing corresponding adapters in the configuration. * [DigitalOcean Spaces](#digitalocean-spaces) * [Scaleway Object Storage](#scaleway-object-storage) * [Google Cloud Storage](#google-cloud-storage) +* [Cloudflare R2](#cloudflare-r2) ## Azure @@ -117,9 +118,10 @@ services: digitalocean_spaces_client: class: 'AsyncAws\S3\S3Client' arguments: - - endpoint: '%env(DIGITALOCEAN_SPACES_ENDPOINT)%' - accessKeyId: '%env(DIGITALOCEAN_SPACES_ID)%' - accessKeySecret: '%env(DIGITALOCEAN_SPACES_SECRET)%' + - + endpoint: '%env(DIGITALOCEAN_SPACES_ENDPOINT)%' + accessKeyId: '%env(DIGITALOCEAN_SPACES_ID)%' + accessKeySecret: '%env(DIGITALOCEAN_SPACES_SECRET)%' flysystem: storages: @@ -142,9 +144,10 @@ services: scaleway_spaces_client: class: 'AsyncAws\S3\S3Client' arguments: - - endpoint: '%env(SCALEWAY_SPACES_ENDPOINT)%' - accessKeyId: '%env(SCALEWAY_SPACES_ID)%' - accessKeySecret: '%env(SCALEWAY_SPACES_SECRET)%' + - + endpoint: '%env(SCALEWAY_SPACES_ENDPOINT)%' + accessKeyId: '%env(SCALEWAY_SPACES_ID)%' + accessKeySecret: '%env(SCALEWAY_SPACES_SECRET)%' flysystem: storages: @@ -155,6 +158,32 @@ flysystem: bucket: '%env(SCALEWAY_SPACES_BUCKET)%' ``` +## Cloudflare R2 + +The Cloudflare R2 is compatible with the AWS S3 API, meaning that you can use the same configuration +as for a AWS storage. For example: + +```yaml +# config/packages/flysystem.yaml + +services: + cloudflare_r2_client: + class: 'AsyncAws\S3\S3Client' + arguments: + - + endpoint: '%env(CLOUDFLARE_R2_ENDPOINT)%' + accessKeyId: '%env(CLOUDFLARE_R2_ID)%' + accessKeySecret: '%env(CLOUDFLARE_R2_SECRET)%' + +flysystem: + storages: + cdn.storage: + adapter: 'asyncaws' + options: + client: 'cloudflare_r2_client' + bucket: '%env(CLOUDFLARE_R2_BUCKET)%' +``` + ## Next [Interacting with FTP and SFTP servers](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/3-interacting-with-ftp-and-sftp-servers.md)