diff --git a/DependencyInjection/Factory/GoogleCloudStorageAdapterFactory.php b/DependencyInjection/Factory/GoogleCloudStorageAdapterFactory.php new file mode 100644 index 0000000..9d47ae1 --- /dev/null +++ b/DependencyInjection/Factory/GoogleCloudStorageAdapterFactory.php @@ -0,0 +1,55 @@ +setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.google_cloud_storage')) + ->addArgument(new Reference($config['service_id'])) + ->addArgument($config['bucket_name']) + ->addArgument($config['options']) + ->addArgument($config['detect_content_type']) + ; + } + + /** + * {@inheritDoc} + */ + public function getKey() + { + return 'google_cloud_storage'; + } + + /** + * {@inheritDoc} + */ + public function addConfiguration(NodeDefinition $builder) + { + $builder + ->children() + ->scalarNode('service_id')->isRequired()->cannotBeEmpty()->end() + ->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end() + ->booleanNode('detect_content_type')->defaultTrue()->end() + ->arrayNode('options') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('directory')->defaultValue('')->end() + ->scalarNode('acl')->defaultValue('private')->end() + ->end() + ->end() + ->end() + ; + } +} diff --git a/Resources/config/adapter_factories.xml b/Resources/config/adapter_factories.xml index 562a144..1099be5 100644 --- a/Resources/config/adapter_factories.xml +++ b/Resources/config/adapter_factories.xml @@ -35,6 +35,9 @@ + + + diff --git a/Resources/config/gaufrette.xml b/Resources/config/gaufrette.xml index 49041e4..160a6cf 100644 --- a/Resources/config/gaufrette.xml +++ b/Resources/config/gaufrette.xml @@ -33,6 +33,7 @@ +