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

refactor: remove $_SESSION from methods and functions #7982

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

pjsde
Copy link
Contributor

@pjsde pjsde commented Sep 26, 2023

Functions and methods should not directly call the $_SESSION array but use the session() helper to obtain their contents from the Services::Session library.

This avoids the need to override code if someone needs to organize the $_SESSION array in another way.

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 the refactor Pull requests that refactor code label Sep 26, 2023
@pjsde pjsde force-pushed the refactor-session-constant-usage branch from a054a4a to 223d5fe Compare September 26, 2023 19:37
system/CodeIgniter.php Outdated Show resolved Hide resolved
@pjsde pjsde force-pushed the refactor-session-constant-usage branch 3 times, most recently from d9c23cc to e1e8c86 Compare September 28, 2023 10:09
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement.
Thank you.

@kenjis
Copy link
Member

kenjis commented Oct 1, 2023

@pjsde We do not include merge commits in PR branches.
Can you do git rebase to remove the merge commit?
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch

pjsde and others added 4 commits October 2, 2023 09:39
Co-authored-by: Mostafa Khudair <59371810+mostafakhudair@users.noreply.github.com>
@pjsde pjsde force-pushed the refactor-session-constant-usage branch from 2b4ef45 to b5d123a Compare October 2, 2023 08:40
@pjsde
Copy link
Contributor Author

pjsde commented Oct 2, 2023

@pjsde We do not include merge commits in PR branches. Can you do git rebase to remove the merge commit

@kenjis Sorry, I hadn't noticed

@kenjis kenjis merged commit ca50f24 into codeigniter4:develop Oct 3, 2023
61 of 62 checks passed
@kenjis
Copy link
Member

kenjis commented Oct 3, 2023

@pjsde Thank you! Glad you are able to use git rebase.

@pjsde pjsde deleted the refactor-session-constant-usage branch October 3, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants