Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extends knpGaufrette configuration #92

Open
steevanb opened this issue May 9, 2014 · 3 comments
Open

Extends knpGaufrette configuration #92

steevanb opened this issue May 9, 2014 · 3 comments
Assignees

Comments

@steevanb
Copy link

steevanb commented May 9, 2014

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
Copy link

wormling commented Sep 2, 2014

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
Copy link
Author

steevanb commented Sep 2, 2014

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

  • Register your bundle "after" GaufretteBundle in AppKernel
  • Let GaufretteBundle register filesystem and adapters with it's config etc
  • Copy Knp\Bundle\GaufretteBundle\DependencyInjection\KnpGaufretteExtension code (can't use it cdause all methods are private and not protected ...) in your bundle, and register olds filesystem and adapters (who were registerred by GaufretteBundle) + your ones.

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
Copy link

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.

@PedroTroller PedroTroller self-assigned this Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants