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

Improve docs readability & example for R2 #171

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 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 @@ -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:
Expand All @@ -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:
Expand All @@ -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)