Skip to content

Commit

Permalink
Add Cloudflare R2 example
Browse files Browse the repository at this point in the history
  • Loading branch information
beganovich authored and maxhelias committed Dec 3, 2024
1 parent 089bf9a commit 26d3794
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/2-cloud-storage-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -157,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)

0 comments on commit 26d3794

Please sign in to comment.