-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Missing Finder component #13810
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
It only depends on Finder for a very specific use case: Registering commands. Many applications using the HttpKernel standalone don't need this feature. That's why it's in the suggests section instead (it isn't required for basic usage). Furthmore, I would not advise you to use any bundle outside of the framework. Btw, this issue will probably be fixed by #9406 |
@wouterj, I agree that registering commands is a very specific use case for HttpKernel, but on the other hand, I don't expect fatal errors from composer-managed package, when suggested dependency is not installed. After some deeper investigation looks like it is FrameworkBundle who needs hard dependency on Finder, since FrameworkBundle is using commands registration, provided by abstract class in HttpKernel.
IMO, this suggestion defeats the purpose of splitting symfony into components, bridges and bundles. |
@RomanShumkov : agreed about the suggsted dependency problem, but i disagree about the splitting comment. Bundles are generally framework specific by definition (not the case with WebProfiler). The components and bridges are split out to be reused. |
I agree that there are some things that should be improved. I propose:
No, exactly the oposite: It is a result of this great decoupling. Due to this decoupling, components and bridges are designed to work standalone. It's the bundles which are designed to integrate this standalone libraries into the Symfony Framework. Without this decoupling, everything would have been coupled to the framework. Now, just the bundles are. |
Not sure if we have the same understanding of what framework is :) For me it's symfony/symfony package and that's why I was surprised by advice of not using bundles outside of the framework . Having dependency on entire symfony/symfony package looks like overkill, when creating/using simple bundle, e.g. for exposing existing non-sf2 application services over the web or command line interface. In theory, bundle is just a plugin/extension point for handling requests using kernel, so having dependency on HttpKernel or FrameworkBundle should be enough, when things like persistence, logging, security etc, are already implemented outside of the bundle (possibly in non-sf2 way). If however suggestion was about depending on FrameworkBundle, just ignore my previous comment.
@wouterj, +1 |
It is very common for a package to "fatal error" when you use a feature that require you to load a suggested package (not symfony specific at all). Having a nice error message is a nice to have but it can't be enforced and require great case by case care and it will certainly be hard if not impossible to enforce these errors everywhere they could be usefull on the long run. |
HttpKernel component depends on finder component, which is not listed in require section of composer.json.
As a result when running console application based on FrameworkBundle and HttpKernel component there is following fatal error:
The text was updated successfully, but these errors were encountered: