Skip to content

Commit 26d3794

Browse files
beganovichmaxhelias
authored andcommitted
Add Cloudflare R2 example
1 parent 089bf9a commit 26d3794

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/2-cloud-storage-providers.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cloud providers by providing corresponding adapters in the configuration.
1010
* [DigitalOcean Spaces](#digitalocean-spaces)
1111
* [Scaleway Object Storage](#scaleway-object-storage)
1212
* [Google Cloud Storage](#google-cloud-storage)
13+
* [Cloudflare R2](#cloudflare-r2)
1314

1415
## Azure
1516

@@ -157,6 +158,32 @@ flysystem:
157158
bucket: '%env(SCALEWAY_SPACES_BUCKET)%'
158159
```
159160
161+
## Cloudflare R2
162+
163+
The Cloudflare R2 is compatible with the AWS S3 API, meaning that you can use the same configuration
164+
as for a AWS storage. For example:
165+
166+
```yaml
167+
# config/packages/flysystem.yaml
168+
169+
services:
170+
cloudflare_r2_client:
171+
class: 'AsyncAws\S3\S3Client'
172+
arguments:
173+
-
174+
endpoint: '%env(CLOUDFLARE_R2_ENDPOINT)%'
175+
accessKeyId: '%env(CLOUDFLARE_R2_ID)%'
176+
accessKeySecret: '%env(CLOUDFLARE_R2_SECRET)%'
177+
178+
flysystem:
179+
storages:
180+
cdn.storage:
181+
adapter: 'asyncaws'
182+
options:
183+
client: 'cloudflare_r2_client'
184+
bucket: '%env(CLOUDFLARE_R2_BUCKET)%'
185+
```
186+
160187
## Next
161188
162189
[Interacting with FTP and SFTP servers](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/3-interacting-with-ftp-and-sftp-servers.md)

0 commit comments

Comments
 (0)