Skip to content

refactor: remove $_SESSION from methods and functions - #7982

Merged
kenjis merged 4 commits into
codeigniter4:developfrom
pjsde:refactor-session-constant-usage
Oct 3, 2023
Merged

kenjis merged 4 commits into
codeigniter4:developfrom
pjsde:refactor-session-constant-usage

Conversation

@pjsde

@pjsde pjsde commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

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
Comment thread system/CodeIgniter.php Outdated
@pjsde
pjsde force-pushed the refactor-session-constant-usage branch 3 times, most recently from d9c23cc to e1e8c86 Compare September 28, 2023 10:09

@kenjis kenjis left a comment

Copy link
Copy Markdown
Member

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.

Comment thread system/Helpers/url_helper.php Outdated
@kenjis

kenjis commented Oct 1, 2023

Copy link
Copy Markdown
Member

@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
@pjsde
pjsde force-pushed the refactor-session-constant-usage branch from 2b4ef45 to b5d123a Compare October 2, 2023 08:40
@pjsde

pjsde commented Oct 2, 2023

Copy link
Copy Markdown
Contributor Author

@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
@kenjis

kenjis commented Oct 3, 2023

Copy link
Copy Markdown
Member

@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