Symfony2: How to dynamically register a bundle (an

2019-04-14 22:03发布

I'm creating some kind of an 'ready to be extended' admin panel. What I'm trying to do is a module for extending some admin panel features by downloading a proper bundle and install it from within admin panel.

I have prepared an additional gallery module and I don't wan to enable it with the standard version of admin panel (or even deploy this bundle to the prod server). The extra gallery bundle should only be installed from, let's say an admin panel/modules site. Where user could upload the gallery module(a bundle, downloaded from the server) and let the application handle the rest which would be: extract the bundle to src/proper_path, register it in AppKernel.php and clear the cache(if it's necessary). The final and only question is: is it possible in Symfony2 and how it can be done?

Is it possible to dynamically register bundles in Symfony2? says it is, but is it a proper or only way? And what about cache clearing, can I run it form a controller? Does the Composer have anything to do with the whole problem, or can help? Extending features of the site using that method is very pupular in many of public free CMS. Do you have any experience or words of wisdom?

0条回答
登录 后发表回答