12 Commits

Author SHA1 Message Date
l3l0
c6da43595c Point to latest stable version of Gaufrette. 2013-01-30 12:41:55 +01:00
Leszek Prabucki
c3b489721b Merge pull request #32 from lmammino/master
Updated Documentation annotations on factories
2013-01-25 00:43:21 -08:00
lmammino
5d1f0ee2f8 Merge branch 'master' of git://github.com/KnpLabs/KnpGaufretteBundle 2013-01-21 11:08:20 +01:00
lmammino
f9614aa3d9 Updated gitignore 2013-01-21 11:07:30 +01:00
lmammino
ccc6a6db15 Fixed documentation annotation for factories 2013-01-21 11:07:19 +01:00
Leszek Prabucki
fe09a0cd03 Merge pull request #28 from lmammino/patch-1
Update FilesystemMap.php
2013-01-03 23:37:20 -08:00
Luciano Mammino
fa0516fb7e Update FilesystemMap.php
Fixed a typo into the documentation
2013-01-04 01:40:30 +01:00
l3l0
2a505d1b30 Fixed definition of ftp adapter. 2012-11-20 10:15:40 +01:00
Leszek Prabucki
4370da0ad4 Merge pull request #26 from l3l0/compatibility-with-new-gaufrette-version
Changes allow to KnpGaufretteBundle work with latest Gaufrette
2012-11-16 00:35:05 -08:00
l3l0
6f5bb2a78a Make amazons3 config to be BC. Added UPGRADE file 2012-11-16 09:30:13 +01:00
l3l0
503e2899c0 Changed version og Gaufrette used by bundle. 2012-11-14 15:40:17 +01:00
l3l0
f27138e80b Replace AmazonS3 create boolean param with array one. Changed
composer.json
2012-11-14 15:36:59 +01:00
8 changed files with 70 additions and 39 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
Tests/Resources/cache
.idea/
vendor/
composer.lock

View File

@@ -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)
{

View File

@@ -31,7 +31,7 @@ interface AdapterFactoryInterface
/**
* Adds configuration nodes for the factory
*
* @param NodeBuilder $builder
* @param NodeDefinition $builder
*/
function addConfiguration(NodeDefinition $builder);
}

View File

@@ -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()
;
}
}
}

View File

@@ -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)
;
}

View File

@@ -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
View 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
```

View File

@@ -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"
}