-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.2] Deprecate getting the router by the app and introduce a service #36688
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
[4.2] Deprecate getting the router by the app and introduce a service #36688
Conversation
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
d6f933a to
5545d3d
Compare
5545d3d to
c83bff8
Compare
|
I would not deprecate it, Web APP still should have it, like it have a Document. Another thing, introducing SiteRouterInterface looks a bit not-intuitive to me, what purpose of it? |
I agree. Just like Document, Session, etc for consistency it should not be deprecated. Otherwise everything should be deprecated. App still should have everything as a shortcut to the container. |
|
I have tested this item ✅ successfully on 51cfca4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36688. |
|
I have tested this item ✅ successfully on f6908c0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36688. |
|
rtc This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36688. |
|
@laoneo This requires another test after the new commit. @BPBlueprint Could you redo your test again? |
|
Thanks everybody. |
|
Pinging @laoneo Actually this PR is not fully b/c and reliable, given than:
is not the same than:
I've noticed that they are 2 separate and different instances of the SiteRouter class. So given for example that the Joomla core uses the container: Factory::getContainer()->get('SiteRouter'): The result will be that the preProcessParseRule function of this plugin will never be called. This implication has potential drawbacks, not sure how it can be solved other than update the code of all extensions to the new container to work on the same instance of the router class. |
|
There is an alias missing for the old class names. Can you give #37381 test? |
Pull Request for pr's #36562, #36629, #36631.
Summary of Changes
As discussed in #36631. It would be better to get the router from a service. Additionally the
getRouterfunction in applications do become deprecated.A second step would be to turn the language plugin into a service provider plugin and inject the router there. The same goes for the finder extension and the applications.
ping @nibra and @wilsonge
Testing Instructions
Actual result BEFORE applying this Pull Request
All is working.
Expected result AFTER applying this Pull Request
All is working.