Skip to content

Commit

Permalink
updates and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaEstes committed Aug 25, 2024
1 parent 8b5d1fd commit d4777c9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/components/filesystem/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ use SonsOfPHP\Component\Filesystem\Adapter\NativeAdapter;

$adapter = new WormAdapter(new NativeAdater('/tmp'));
```

## Additional Adapters

### AWS S3

```shell
composer require sonsofphp/filesystem-aws
```

```php
<?php

use SonsOfPHP\Bridge\Aws\Filesystem\Adapter\S3Adapter;

$adapter = new S3Adapter($s3Client, 'bucket-name');
```
31 changes: 31 additions & 0 deletions docs/components/filesystem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,37 @@ $filesystem->copy('source.txt', 'destination.txt');
$filesystem->move('source.txt', 'destination.txt');
```

## Support for LiipImagineBundle

```shell
composer require sonsofphp/filesystem-liip-imagine
```

```yaml
# config/services.yaml
services:
SonsOfPHP\Contract\Filesystem\Adapter\AdapterInterface:
class: SonsOfPHP\Component\Filesystem\Adapter\NativeAdapter
arguments: ['%kernel.project_dir%/var/data/%kernel.id%']
SonsOfPHP\Contract\Filesystem\FilesystemInterface:
class: SonsOfPHP\Component\Filesystem\Filesystem
arguments: ['@SonsOfPHP\Contract\Filesystem\Adapter\AdapterInterface']
imagine.cache.resolver.sonsofphp:
class: SonsOfPHP\Bridge\LiipImagine\Filesystem\Imagine\Cache\Resolver\SonsOfPHPFilesystemResolver
arguments:
- '@SonsOfPHP\Contract\Filesystem\FilesystemInterface'
- 'https://images.example.com'
tags:
- { name: "liip_imagine.cache.resolver", resolver: sonsofphp }
```
```yaml
# config/packages/liip_imagine.yaml
liip_imagine:
data_loader: SonsOfPHP\Bridge\LiipImagine\Filesystem\Binary\Loader\SonsOfPHPFilesystemLoader
cache: sonsofphp
```
## Need Help?
Check out [Sons of PHP's Organization Discussions][discussions].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use SonsOfPHP\Contract\Filesystem\FilesystemInterface;
use Symfony\Component\Mime\MimeTypesInterface;

/**
* @author Joshua Estes <[email protected]>
*/
class SonsOfPHPFilesystemLoader implements LoaderInterface
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface;
use SonsOfPHP\Contract\Filesystem\FilesystemInterface;

/**
* @author Joshua Estes <[email protected]>
*/
class SonsOfPHPFilesystemResolver implements ResolverInterface
{
public function __construct(
Expand Down

0 comments on commit d4777c9

Please sign in to comment.