-
-
Notifications
You must be signed in to change notification settings - Fork 495
[framework-bundle] [bug] the proposed Kernel::registerBundles
implementation is not consistent
#46
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
Comments
Kernel::registerBundles
implementation is not consistentKernel::registerBundles
implementation is not consistent
I wonder why this was even done, you are going to initialize all anyway 🤔 @nicolas-grekas You have worked with this before, can you explain why it is done here? |
@docteurklein Thinking about this, why do load the bundles multiple times? Because it would initialize them multiple times then 😐 you can use I guess we need to validate if the bundles are already initialized. |
the problem lies here: Not sure yet why this is done like this |
I think it should be calling |
indeed, based on what I see here: symfony/framework-bundle@cfcfae0 it used to call |
…ering bundles twice (ogizanagi) This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/recipes#46 | License | MIT | Doc PR | N/A As spotted in symfony/recipes#46, there is no reason to call `registerBundles` on the kernel instance, as it's already booted. So we just have to use `getBundles` instead and `registerBundles` can be implemented in a non-rewindable way, as done with flex. Commits ------- 040edfe [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice
…ering bundles twice (ogizanagi) This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/recipes#46 | License | MIT | Doc PR | N/A As spotted in symfony/recipes#46, there is no reason to call `registerBundles` on the kernel instance, as it's already booted. So we just have to use `getBundles` instead and `registerBundles` can be implemented in a non-rewindable way, as done with flex. Commits ------- 040edfec4a [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice
Uh oh!
There was an error while loading. Please reload this page.
yield
ing bundle instances makes it incompatible with multiple iterations (Generators cannot berewind
ed once iterated, generating this kind of exceptions:I propose either to return a typical
array
, or to useiterator_to_array
in portions of code that needs multiple iterations, or refactor the way bundles are initialized.The text was updated successfully, but these errors were encountered: