-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Remove arguments of Factory::getApplication as they are misleading #18898
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.0] Remove arguments of Factory::getApplication as they are misleading #18898
Conversation
|
So if we do this do we actually want to have the |
|
If we are removing the app singletons we need to ensure that running the app constructors multiple times doesn't create side effects on the primary app and dependencies. |
|
|
|
Most of the container services are shared already anyway. But even outside of that, my point isn't about having singletons but about ensuring that running |
|
I guess we should keep |
|
Ahh i missed |
|
Regardless of whether the getInstance method lives forever or disappears tomorrow, we still need to ensure that running the constructors multiple times doesn't create side effects. That is the only concern with removing this specific singleton store, every other service that has singleton doesn't have global reach like the application does.
This is a move in the right direction, just pointing out technical concerns in getting to the end state. |
|
Needs the "Documentation Required" label. |
|
Thanks done! @mbabker just to confirm that only applies to when we remove |
|
Right. |
Factory::getApplication();doesn't take any arguments anymore and will return always the global application object which must be set by the front controller during the set up phase. The problem on that part in J3 is that the codewill always return the site app, despite the administrator app is requested. This can be done now trough
Factory::getContainer()->get('SiteApplication');which will return a site application even on the back end.I'm splitting #16918 into different pr's to be easier to review.