-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
[Proposal] New FrameworkConfigurator to configure framework-bundle #247
Comments
Actualy, i have already created |
At first sight I'm not sure that
This way, Flex might retrieve configuration files from this package's recipe, if it already has a recipe, and update its main config file. If no file exists, maybe we could have different options: create a new file, update current package's config according to these extension points, or throw an exception to force the creation of a recipe or specify a config file in the manifest... WDYT? |
@Pierstoval i think, it will be difficult (if not imposible) for With my proposal, there will be only one default configuration for each framework extension, and these default configurations will be controlled by See config.yml from So, with |
FrameworkBundle auto-enables most of its components based on the fact that the corresponding package is installed. |
@stof yes, i saw that PR about enabling session with Right now my goal is to have recipe for framework:
assets: ~
session: ~
templating:
engines: ["twig"] But with |
Well, for the templating part, the admin bundle should rather migrate to using the native Twig notation for templates, and using the Twig service directly. We precisely want to discourage the usage of the Templating wrapper in Flex projects. Regarding assets, it is already auto-enabled based on the detection of the asset component. |
I run into this issue for the same reason: trying to create a sonata admin recipe. Not only I have the issue with session but also with the "security" options which I also want to make part of the bundle. Maybe it can be handled in a similar way? |
@stof apparently, I missed all the fun with framework-bundle configuration =( Confusion arose from the session service (and because of inattention, of course). But, anyway FrameworkConfigurator could be useful, it not - please close this issue |
that's not true. If you remove a package and this removes the need to install |
I agree and give up. So, i'm closing this issue |
See symfony/recipes#262
Right now bundles, that requires
session
service can not work properly if session is not configured inframework.yaml
. But developer will have to configuresession
anyway to make a bundle work. And it is not about session only: some of them usesform
, another - usesassets
,liip/theme-bundle
usestemplating
(symfony/recipes-contrib#209),sonata/core-bundle
usessession
(symfony/recipes-contrib#151).Of course, bundles could contain some CompilerPass like CheckForSessionPass, created by @weaverryan for FOSUserBundle.
But if so, every time developer starts a project, he will see the same message like "FOSUserBundle requires the "session" service to be available. Uncomment the "session" section in "config/packages/framework.yaml" to activate it.". For
assets
ortemplating
there will be instructions too.And all these bundle will have their copies of
CheckForSessionPass
to tell developer what he has to do next. And if in the future there will be changes in FrameworkBundle, all these bundles will have to change instructions in compler passes too.If there won't be any CompilerPass, developer will see message during
cache:clear
like this:I believe that none of the described options are optimal. So, i suggest adding a new configurator
FrameworkConfigurator
. It will accept new recipe definition inmanifest.json
like this:It means, that recipe/package requires
session
,assets
andform
modules to be enabled, to work properly.To make
FrameworkConfigurator
work, we must fill config/packages/framework.yaml with commented default configuration for framework-bundle modules. All these configurations must be commented with double sharp sign.So, then if
FrameworkConfigurator
will meetassets
orsession
inframework
section ofmanifest.json
, it will remove double sharps in the corresponding lines automaticaly. Unfortunately removing double sharp cannot be unconfigured if several packages requires the same. But, if session or assets will be enabled, application will not became broken, so we can not pay attention to it.The text was updated successfully, but these errors were encountered: