Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6da43595c | ||
|
|
c3b489721b | ||
|
|
5d1f0ee2f8 | ||
|
|
f9614aa3d9 | ||
|
|
ccc6a6db15 | ||
|
|
fe09a0cd03 | ||
|
|
fa0516fb7e | ||
|
|
2a505d1b30 | ||
|
|
4370da0ad4 | ||
|
|
6f5bb2a78a | ||
|
|
503e2899c0 | ||
|
|
f27138e80b |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,4 @@
|
||||
Tests/Resources/cache
|
||||
.idea/
|
||||
vendor/
|
||||
composer.lock
|
||||
|
||||
@@ -10,12 +10,8 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
{
|
||||
/**
|
||||
* Creates the adapter, registers it and returns its id
|
||||
*
|
||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
||||
* @param string $id The id of the service
|
||||
* @param array $config An array of configuration
|
||||
*/
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function create(ContainerBuilder $container, $id, array $config)
|
||||
{
|
||||
$container
|
||||
@@ -42,9 +38,7 @@ class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the key for the factory configuration
|
||||
*
|
||||
* @return string
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
@@ -52,9 +46,7 @@ class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds configuration nodes for the factory
|
||||
*
|
||||
* @param NodeBuilder $builder
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function addConfiguration(NodeDefinition $builder)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ interface AdapterFactoryInterface
|
||||
/**
|
||||
* Adds configuration nodes for the factory
|
||||
*
|
||||
* @param NodeBuilder $builder
|
||||
* @param NodeDefinition $builder
|
||||
*/
|
||||
function addConfiguration(NodeDefinition $builder);
|
||||
}
|
||||
|
||||
@@ -10,26 +10,24 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
{
|
||||
/**
|
||||
* Creates the adapter, registers it and returns its id
|
||||
*
|
||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
||||
* @param string $id The id of the service
|
||||
* @param array $config An array of configuration
|
||||
*/
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function create(ContainerBuilder $container, $id, array $config)
|
||||
{
|
||||
$container
|
||||
$definition = $container
|
||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.amazon_s3'))
|
||||
->addArgument(new Reference($config['amazon_s3_id']))
|
||||
->addArgument($config['bucket_name'])
|
||||
->addArgument($config['create'])
|
||||
;
|
||||
->addArgument($config['bucket_name']);
|
||||
|
||||
if (isset($config['options'])) {
|
||||
$definition->addArgument($config['options']);
|
||||
} elseif (isset($config['create'])) {
|
||||
$definition->addArgument(array('create' => $config['create']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the key for the factory configuration
|
||||
*
|
||||
* @return string
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
@@ -37,9 +35,7 @@ class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds configuration nodes for the factory
|
||||
*
|
||||
* @param NodeBuilder $builder
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function addConfiguration(NodeDefinition $builder)
|
||||
{
|
||||
@@ -47,8 +43,17 @@ class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||
->children()
|
||||
->scalarNode('amazon_s3_id')->isRequired()->cannotBeEmpty()->end()
|
||||
->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end()
|
||||
->booleanNode('create')->defaultFalse()->end()
|
||||
->booleanNode('create')->end()
|
||||
->arrayNode('options')
|
||||
->children()
|
||||
->booleanNode('create')
|
||||
->defaultFalse()
|
||||
->end()
|
||||
->scalarNode('region')->end()
|
||||
->scalarNode('directory')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,7 @@ class FtpAdapterFactory implements AdapterFactoryInterface
|
||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.ftp'))
|
||||
->addArgument($config['directory'])
|
||||
->addArgument($config['host'])
|
||||
->addArgument($config['username'])
|
||||
->addArgument($config['password'])
|
||||
->addArgument($config['port'])
|
||||
->addArgument($config['passive'])
|
||||
->addArgument($config['create'])
|
||||
->addArgument($config['mode'])
|
||||
->addArgument($config)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class FilesystemMap implements \IteratorAggregate
|
||||
protected $map;
|
||||
|
||||
/**
|
||||
* Instanciates a new filesystem map
|
||||
* Instantiates a new filesystem map
|
||||
*
|
||||
* @param array $map
|
||||
*/
|
||||
|
||||
31
UPGRADE
Normal file
31
UPGRADE
Normal file
@@ -0,0 +1,31 @@
|
||||
UPGRADE FROM 0.1 to 0.2
|
||||
=======================
|
||||
|
||||
### AmazonS3
|
||||
|
||||
* In 0.2 we pass additional options for AmazonS3 Gaufrette provider AmazonS3 config was changed (old way is DEPRECIATED)
|
||||
|
||||
before:
|
||||
|
||||
```yml
|
||||
knp_gaufrette:
|
||||
adapters:
|
||||
adaptername:
|
||||
amazon_s3:
|
||||
amazon_s3_id: amazon_s3.service.id
|
||||
bucket_name: mybucketname
|
||||
create: true
|
||||
```
|
||||
|
||||
after:
|
||||
|
||||
```yml
|
||||
knp_gaufrette:
|
||||
adapters:
|
||||
adaptername:
|
||||
amazon_s3:
|
||||
amazon_s3_id: amazon_s3.service.id
|
||||
bucket_name: mybucketname
|
||||
options:
|
||||
create: true
|
||||
```
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"require": {
|
||||
"symfony/framework-bundle": "2.*",
|
||||
"knplabs/gaufrette": "0.1.3"
|
||||
"knplabs/gaufrette": "0.1.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/yaml": "2.*",
|
||||
@@ -28,5 +28,10 @@
|
||||
"Knp\\Bundle\\GaufretteBundle": ""
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.2.x-dev"
|
||||
}
|
||||
},
|
||||
"target-dir": "Knp/Bundle/GaufretteBundle"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user