KnpLabs / KnpGaufretteBundle

Easily use Gaufrette in your Symfony projects.
http://knplabs.com
MIT License
717 stars 157 forks source link

Extends knpGaufrette configuration #92

Open steevanb opened 10 years ago

steevanb commented 10 years ago

Hi,

There is a little problem in Knp\Bundle\GaufretteBundle\DependencyInjection\KnpGaufretteExtension, line 54, with this code : $container->getDefinition('knp_gaufrette.filesystem_map')->replaceArgument(0, $map); If i want to make a bundle who add adapters and filesystems, i can't, cause this code will replace everything i've added (in case of my bundle is registered after GaufretteBundle in AppKernel, if GaufretteBundle is registered after my bundle, my adapters and filesystems are deleted by this code).

Could you make methods on your knp_gaufrette.filesystem_map service, like addAdapter and addFileSystem, and call it from your config loader ? In this case, my bundle can add adpeters and filesystem without any problems :)

While you are on KnpGaufretteExtension, could you set all your methods to protected ? I need it cause if i extends your KnpGaufretteExtension, i can't use your methods :(

Thanks, Steevan

wormling commented 10 years ago

steevanb: Did you ever find a way to work through this? I have a couple adapters I would also like put in a bundle. Is your adapter bundle code available as an example?

steevanb commented 10 years ago

Hi, I don't have this code, cause it's proprietary. It was something like this :

I know it's now nice, but it's the only way i've found to not fork GaufretteBundle and fix the configuration problem.

richsage commented 8 years ago

It'd also be nice if the factories were actually added to the main container as well, instead of being used in a temporary container. We have a use case that requires adapters and filesystems to be registered dynamically at runtime, depending on the subdomain used for the app, and ideally it would be nice to use the factories within the bundle in a similar fashion to the bundle's normal initialisation.