Skip to content

Commit fcf89e9

Browse files
committed
feat: document custom storage
1 parent 5a68652 commit fcf89e9

File tree

1 file changed

+14
-2
lines changed
  • src/Web/Documentation/content/main/2-tempest-in-depth

1 file changed

+14
-2
lines changed

src/Web/Documentation/content/main/2-tempest-in-depth/03-storage.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ $storage->fileOrDirectoryExists($location);
8181

8282
Tempest provides a different configuration object for each storage provider. Below are the ones that are currently supported:
8383

84+
- {`Tempest\Storage\Config\LocalStorageConfig`}
8485
- {`Tempest\Storage\Config\R2StorageConfig`}
8586
- {`Tempest\Storage\Config\S3StorageConfig`}
8687
- {`Tempest\Storage\Config\AzureStorageConfig`}
8788
- {`Tempest\Storage\Config\FTPStorageConfig`}
8889
- {`Tempest\Storage\Config\GoogleCloudStorageConfig`}
8990
- {`Tempest\Storage\Config\InMemoryStorageConfig`}
90-
- {`Tempest\Storage\Config\LocalStorageConfig`}
9191
- {`Tempest\Storage\Config\SFTPStorageConfig`}
9292
- {`Tempest\Storage\Config\StorageConfig`}
9393
- {`Tempest\Storage\Config\ZipArchiveStorageConfig`}
@@ -145,7 +145,7 @@ composer require league/flysystem-read-only
145145

146146
Once this is done, you may pass the `readonly` parameter to the adapter configuration and set it to `true`.
147147

148-
```php src/data-snapshots.storage.confg.php
148+
```php src/data-snapshots.storage.config.php
149149
return new S3StorageConfig(
150150
tag: StorageLocation::DATA_SNAPSHOTS,
151151
readonly: true,
@@ -156,6 +156,18 @@ return new S3StorageConfig(
156156
);
157157
```
158158

159+
### Custom storage
160+
161+
If you need to implement your own adapter for an unsupported provider, you may do so by implementing the `League\Flysystem\FilesystemAdapter` interface.
162+
163+
Tempest provides a {b`Tempest\Storage\Config\CustomStorageConfig`} configuration object which accepts any `FilesystemAdapter`, which will be resolved through the container.
164+
165+
```php src/custom-storage.config.php
166+
return new CustomStorageConfig(
167+
adapter: App\MyCustomFilesystemAdapter::class,
168+
);
169+
```
170+
159171
## Testing
160172

161173
By extending {`Tempest\Framework\Testing\IntegrationTest`} from your test case, you gain access to the storage testing utilities through the `storage` property.

0 commit comments

Comments
 (0)