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 Tests/Resources/cache
.idea/
vendor/
composer.lock

View File

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

View File

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

View File

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

View File

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

View File

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