-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Oneup\FlysystemBundle\DependencyInjection\Factory\Adapter; | ||
|
||
use Symfony\Component\Config\Definition\Builder\NodeDefinition; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\ChildDefinition; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use Oneup\FlysystemBundle\DependencyInjection\Factory\AdapterFactoryInterface; | ||
|
||
class AsyncAwsS3Factory implements AdapterFactoryInterface | ||
{ | ||
public function getKey() | ||
{ | ||
return 'async_aws_s3'; | ||
} | ||
|
||
public function create(ContainerBuilder $container, $id, array $config) | ||
{ | ||
$container | ||
->setDefinition($id, new ChildDefinition('oneup_flysystem.adapter.async_aws_s3')) | ||
->replaceArgument(0, new Reference($config['client'])) | ||
->replaceArgument(1, $config['bucket']) | ||
->replaceArgument(2, $config['prefix']) | ||
->addArgument($config['options']) | ||
; | ||
} | ||
|
||
public function addConfiguration(NodeDefinition $node) | ||
{ | ||
$node | ||
->children() | ||
->scalarNode('client')->isRequired()->end() | ||
->scalarNode('bucket')->isRequired()->end() | ||
->scalarNode('prefix')->treatNullLike('')->defaultValue('')->end() | ||
->variableNode('options')->treatNullLike([])->defaultValue([])->end() | ||
->end() | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Use the AsyncAwsS3 adapter | ||
|
||
In order to use the AsyncAwsS3 adapter, you first need to create a S3 client service. | ||
This can be done with the following configuration. Read more about instantiating | ||
the S3 client at [async-aws.com](https://async-aws.com/clients/) or use the | ||
[AsyncAws SymfonyBundle](https://async-aws.com/integration/symfony-bundle.html). | ||
|
||
```yml | ||
services: | ||
acme.async_s3_client: | ||
class: AsyncAws\S3\S3Client | ||
arguments: | ||
- region: 'eu-central-1' | ||
accessKeyId: 'AKIAIOSFODNN7EXAMPLE' | ||
accessKeySecret: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' | ||
``` | ||
Set this service as the value of the `client` key in the `oneup_flysystem` configuration. | ||
|
||
```yml | ||
oneup_flysystem: | ||
adapters: | ||
acme.flysystem_adapter: | ||
async_aws_s3: | ||
client: acme.s3_client | ||
bucket: 'my_image_bucket' | ||
prefix: '' | ||
``` | ||
|
||
## More to know | ||
|
||
* [Create and use your filesystem](filesystem_create.md) | ||
* [Add a cache](filesystem_cache.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters