Skip to content

Commit 681f910

Browse files
authored
Merge pull request #910 from kubk/patch-1
Add example for Digital Ocean Spaces
2 parents 168dbe5 + 52f2ebb commit 681f910

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/adapter/digitalocean-spaces.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,30 @@ title: DigitalOcean Spaces
88

99
The DO Spaces api are compatible with those of S3, from Flysystem's perspective this means you can use the
1010
`league/flysystem-aws-s3-v3` adapter.
11+
12+
## Installation
13+
14+
~~~ bash
15+
composer require league/flysystem-aws-s3-v3
16+
~~~
17+
18+
## Usage
19+
20+
~~~ php
21+
use Aws\S3\S3Client;
22+
use League\Flysystem\AwsS3v3\AwsS3Adapter;
23+
use League\Flysystem\Filesystem;
24+
25+
$client = new S3Client([
26+
'credentials' => [
27+
'key' => 'your-key',
28+
'secret' => 'your-secret',
29+
],
30+
'region' => 'your-region',
31+
'version' => 'latest|version',
32+
'endpoint' => 'https://your-region.digitaloceanspaces.com',
33+
]);
34+
35+
$adapter = new AwsS3Adapter($client, 'your-bucket-name');
36+
37+
$filesystem = new Filesystem($adapter);

0 commit comments

Comments
 (0)