Added support for azure blob storage (introduced here: https://github.com/KnpLabs/Gaufrette/pull/206)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
|
||||
|
||||
|
||||
class AzureBlobStorageAdapterFactory implements AdapterFactoryInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function create(ContainerBuilder $container, $id, array $config)
|
||||
{
|
||||
$definition = $container
|
||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.azure_blob_storage'))
|
||||
->addArgument(new Reference($config['blob_proxy_factory_id']))
|
||||
->addArgument($config['container_name'])
|
||||
->addArgument($config['create_container'])
|
||||
->addArgument($config['detect_content_type']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
return 'azure_blob_storage';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function addConfiguration(NodeDefinition $builder)
|
||||
{
|
||||
$builder
|
||||
->children()
|
||||
->scalarNode('blob_proxy_factory_id')->isRequired()->cannotBeEmpty()->end()
|
||||
->scalarNode('container_name')->isRequired()->cannotBeEmpty()->end()
|
||||
->booleanNode('create_container')->defaultValue(false)->end()
|
||||
->booleanNode('detect_content_type')->defaultValue(true)->end()
|
||||
->end()
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user