Skip to content
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

Remove Config\App Session items #7255

Merged
merged 9 commits into from
Jun 23, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Feb 15, 2023

Description
Supersedes #7000

This PR is needed for #7308
Session should not depends on Config\App. See #4297 (comment)

  • remove Config\App session items
  • add property for Config\Session in Session

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them breaking change Pull requests that may break existing functionalities 4.4 labels Feb 15, 2023
@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch from de06247 to 597e35e Compare February 15, 2023 02:51
@mostafakhudair
Copy link
Contributor

Shall we add default config properties in system/Session/Session.php to avoid breaking app?, what if the developer removed some properties from app/Config/Session.php?

@kenjis
Copy link
Member Author

kenjis commented Feb 17, 2023

what if the developer removed some properties from app/Config/Session.php?

It breaks.
If a dev removes Config\App::$baseURL now, the framework does not work.
It is not designed to work by removing necessary Config properties.

I don't see the significance of adding properties that just copies the properties of the Config class.

@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch 2 times, most recently from 3f2513f to 9a6bcff Compare February 25, 2023 03:26
@kenjis kenjis changed the title Remove Config\App session items Remove Config\App Session items Feb 27, 2023
@kenjis kenjis mentioned this pull request Mar 26, 2023
5 tasks
@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch from 9a6bcff to 3c582a1 Compare April 11, 2023 12:33
@kenjis
Copy link
Member Author

kenjis commented Apr 11, 2023

Rebased to resolve conflicts.

Can anyone review?

@kenjis kenjis added the stale Pull requests with conflicts label Apr 30, 2023
@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch from 3c582a1 to 482df99 Compare May 24, 2023 00:10
@kenjis kenjis removed the stale Pull requests with conflicts label May 24, 2023
@kenjis
Copy link
Member Author

kenjis commented May 24, 2023

Rebased.

@iRedds
Copy link
Collaborator

iRedds commented May 24, 2023

This PR tries to get rid of the dependency on Config\App in Services::session() to prevent an infinite loop if the Config\App constructor is accessing a session.
But Services::session() depends on Services::request() which depends on Config\App.

That is, the call point of the infinite loop has shifted from Services::session() to Services::request().
Or am I wrong?

@kenjis
Copy link
Member Author

kenjis commented May 24, 2023

@iRedds You are correct.
I started this to remove the infinite loop, but it is not possible with this PR.
See #7308 (comment)

But I think removing deprecated items in Config\App is worth doing.
It can remove code to fallback, and the code will be simpler.

We have already removed the deprecated Cookie items in Config\App:
https://github.com/codeigniter4/CodeIgniter4/blob/4.4/user_guide_src/source/installation/upgrade_440.rst#appconfigcookiephp

@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch from 482df99 to 612f08a Compare May 24, 2023 08:38
@iRedds
Copy link
Collaborator

iRedds commented May 24, 2023

Oh, I must have missed that comment. My bad.

@kenjis kenjis added the stale Pull requests with conflicts label Jun 10, 2023
@kenjis kenjis force-pushed the remove-config-app-session-4.4 branch from 612f08a to 7dda3b1 Compare June 17, 2023 01:12
@kenjis kenjis removed the stale Pull requests with conflicts label Jun 17, 2023
@kenjis
Copy link
Member Author

kenjis commented Jun 17, 2023

Rebased to resolve conflicts.

@kenjis
Copy link
Member Author

kenjis commented Jun 20, 2023

I would like to merge this. Review, please.

@kenjis kenjis merged commit 0b226dd into codeigniter4:4.4 Jun 23, 2023
@kenjis kenjis deleted the remove-config-app-session-4.4 branch June 23, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants