diff --git a/DependencyInjection/Factory/AwsS3AdapterFactory.php b/DependencyInjection/Factory/AwsS3AdapterFactory.php new file mode 100644 index 0000000..c2ad8aa --- /dev/null +++ b/DependencyInjection/Factory/AwsS3AdapterFactory.php @@ -0,0 +1,55 @@ +setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.aws_s3')) + ->addArgument(new Reference($config['service_id'])) + ->addArgument($config['bucket_name']) + ->addArgument($config['options']) + ; + } + + /** + * {@inheritDoc} + */ + public function getKey() + { + return 'aws_s3'; + } + + /** + * {@inheritDoc} + */ + public function addConfiguration(NodeDefinition $builder) + { + $builder + ->children() + ->scalarNode('service_id')->isRequired()->cannotBeEmpty()->end() + ->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end() + ->arrayNode('options') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('directory')->defaultValue('')->end() + ->booleanNode('create') + ->defaultFalse() + ->end() + ->end() + ->end() + ->end() + ; + } +} diff --git a/Resources/config/adapter_factories.xml b/Resources/config/adapter_factories.xml index 28ae34c..ce3aca0 100644 --- a/Resources/config/adapter_factories.xml +++ b/Resources/config/adapter_factories.xml @@ -20,6 +20,9 @@ + + + diff --git a/Resources/config/gaufrette.xml b/Resources/config/gaufrette.xml index 3c08ac0..20f1a8e 100644 --- a/Resources/config/gaufrette.xml +++ b/Resources/config/gaufrette.xml @@ -23,6 +23,7 @@ +