diff --git a/DependencyInjection/Factory/AmazonS3AdapterFactory.php b/DependencyInjection/Factory/AmazonS3AdapterFactory.php new file mode 100644 index 0000000..f583d7b --- /dev/null +++ b/DependencyInjection/Factory/AmazonS3AdapterFactory.php @@ -0,0 +1,54 @@ +setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.amazon_s3')) + ->addArgument(new Reference($config['amazon_s3_id'])) + ->addArgument($config['bucket_name']) + ->addArgument($config['create']) + ; + } + + /** + * Returns the key for the factory configuration + * + * @return string + */ + public function getKey() + { + return 'amazon_s3'; + } + + /** + * Adds configuration nodes for the factory + * + * @param NodeBuilder $builder + */ + public function addConfiguration(NodeDefinition $builder) + { + $builder + ->children() + ->scalarNode('amazon_s3_id')->isRequired()->cannotBeEmpty()->end() + ->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end() + ->booleanNode('create')->defaultFalse()->end() + ->end() + ; + } +} \ No newline at end of file diff --git a/DependencyInjection/KnpGaufretteExtension.php b/DependencyInjection/KnpGaufretteExtension.php index a0c7134..39e9d47 100644 --- a/DependencyInjection/KnpGaufretteExtension.php +++ b/DependencyInjection/KnpGaufretteExtension.php @@ -87,6 +87,7 @@ class KnpGaufretteExtension extends Extension ; if (!empty($config['alias'])) { + $container->getDefinition($id)->setPublic(false); $container->setAlias($config['alias'], $id); } diff --git a/Resources/config/adapter_factories.xml b/Resources/config/adapter_factories.xml index 415e87e..52359ca 100644 --- a/Resources/config/adapter_factories.xml +++ b/Resources/config/adapter_factories.xml @@ -17,6 +17,9 @@ + + + diff --git a/Resources/config/gaufrette.xml b/Resources/config/gaufrette.xml index 886ecc8..10cc03c 100644 --- a/Resources/config/gaufrette.xml +++ b/Resources/config/gaufrette.xml @@ -19,6 +19,7 @@ +