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
|
Tests/Resources/cache
|
||||||
|
.idea/
|
||||||
|
vendor/
|
||||||
|
composer.lock
|
||||||
|
|||||||
@@ -10,11 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates the adapter, registers it and returns its id
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
|
||||||
* @param string $id The id of the service
|
|
||||||
* @param array $config An array of configuration
|
|
||||||
*/
|
*/
|
||||||
public function create(ContainerBuilder $container, $id, array $config)
|
public function create(ContainerBuilder $container, $id, array $config)
|
||||||
{
|
{
|
||||||
@@ -42,9 +38,7 @@ class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the key for the factory configuration
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getKey()
|
public function getKey()
|
||||||
{
|
{
|
||||||
@@ -52,9 +46,7 @@ class AclAwareAmazonS3AdapterFactory implements AdapterFactoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds configuration nodes for the factory
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param NodeBuilder $builder
|
|
||||||
*/
|
*/
|
||||||
public function addConfiguration(NodeDefinition $builder)
|
public function addConfiguration(NodeDefinition $builder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ interface AdapterFactoryInterface
|
|||||||
/**
|
/**
|
||||||
* Adds configuration nodes for the factory
|
* Adds configuration nodes for the factory
|
||||||
*
|
*
|
||||||
* @param NodeBuilder $builder
|
* @param NodeDefinition $builder
|
||||||
*/
|
*/
|
||||||
function addConfiguration(NodeDefinition $builder);
|
function addConfiguration(NodeDefinition $builder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,26 +10,24 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates the adapter, registers it and returns its id
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
|
||||||
* @param string $id The id of the service
|
|
||||||
* @param array $config An array of configuration
|
|
||||||
*/
|
*/
|
||||||
public function create(ContainerBuilder $container, $id, array $config)
|
public function create(ContainerBuilder $container, $id, array $config)
|
||||||
{
|
{
|
||||||
$container
|
$definition = $container
|
||||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.amazon_s3'))
|
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.amazon_s3'))
|
||||||
->addArgument(new Reference($config['amazon_s3_id']))
|
->addArgument(new Reference($config['amazon_s3_id']))
|
||||||
->addArgument($config['bucket_name'])
|
->addArgument($config['bucket_name']);
|
||||||
->addArgument($config['create'])
|
|
||||||
;
|
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
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getKey()
|
public function getKey()
|
||||||
{
|
{
|
||||||
@@ -37,9 +35,7 @@ class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds configuration nodes for the factory
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param NodeBuilder $builder
|
|
||||||
*/
|
*/
|
||||||
public function addConfiguration(NodeDefinition $builder)
|
public function addConfiguration(NodeDefinition $builder)
|
||||||
{
|
{
|
||||||
@@ -47,7 +43,16 @@ class AmazonS3AdapterFactory implements AdapterFactoryInterface
|
|||||||
->children()
|
->children()
|
||||||
->scalarNode('amazon_s3_id')->isRequired()->cannotBeEmpty()->end()
|
->scalarNode('amazon_s3_id')->isRequired()->cannotBeEmpty()->end()
|
||||||
->scalarNode('bucket_name')->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()
|
->end()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,7 @@ class FtpAdapterFactory implements AdapterFactoryInterface
|
|||||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.ftp'))
|
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.ftp'))
|
||||||
->addArgument($config['directory'])
|
->addArgument($config['directory'])
|
||||||
->addArgument($config['host'])
|
->addArgument($config['host'])
|
||||||
->addArgument($config['username'])
|
->addArgument($config)
|
||||||
->addArgument($config['password'])
|
|
||||||
->addArgument($config['port'])
|
|
||||||
->addArgument($config['passive'])
|
|
||||||
->addArgument($config['create'])
|
|
||||||
->addArgument($config['mode'])
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class FilesystemMap implements \IteratorAggregate
|
|||||||
protected $map;
|
protected $map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instanciates a new filesystem map
|
* Instantiates a new filesystem map
|
||||||
*
|
*
|
||||||
* @param array $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": {
|
"require": {
|
||||||
"symfony/framework-bundle": "2.*",
|
"symfony/framework-bundle": "2.*",
|
||||||
"knplabs/gaufrette": "0.1.3"
|
"knplabs/gaufrette": "0.1.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/yaml": "2.*",
|
"symfony/yaml": "2.*",
|
||||||
@@ -28,5 +28,10 @@
|
|||||||
"Knp\\Bundle\\GaufretteBundle": ""
|
"Knp\\Bundle\\GaufretteBundle": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "0.2.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
"target-dir": "Knp/Bundle/GaufretteBundle"
|
"target-dir": "Knp/Bundle/GaufretteBundle"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user