-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] Use the options from the app instead of the global config #19531
Conversation
Well, here's the problem. The session service is instantiated by the application service, so Eventually, we will need a |
Made a quick test and I could move setting the session from the app service provider here to the execute function. So it should be possible to load the session after the app is created in the application service provider. As said just a quick test didn't test other stuff. |
Well, you can do that, but then you've got the application arbitrarily injecting its own dependencies (either by creating them inline or accessing the container). So we're losing a huge piece of testability here if This is just one of those spots that aren't pretty because configuring the session service is reliant on the active application. So either the session config keeps a dependency to JFactory or you break dependency injection on the application. |
You got me wrong. I didn't say I want to do it that way. Just wanted to test if the session instance is really needed when creating the application in the container. |
To create the application, the session isn't needed. But to create the session, the application is needed. That's where we are running into problems. |
Just to be clear here, it's not an architectural dependency; it's all configuration based (the force SSL option being on a per-client basis as an example, or the default value of the |
I guess we shifted here. Lets get the session issue sorted in another pr then. |
…der/session/config # Conflicts: # libraries/src/Service/Provider/Session.php
Conflicts fixed. |
Sooner or later we're really going to need a For now this PR seems fine, but that really needs to be one of the next architecture steps we take. |
I will have a look into the configuration service provider. |
Pr for config service provider #19658. |
Closing this one then. |
Use the config variables in the session service provider from the application. Question here, should the app not being fetched from the container instead of the Factory?
I'm splitting #16918 into different pr's to be easier to review.