Skip to content

Unify headers already sent/session already started error handler #16451

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

Merged

Conversation

NattyNarwhal
Copy link
Member

Unifies the error formatting for when a session was already started or headers were already sent in ext/session. This is an evolution of GH-16378, motivated by the fact some places were neglected with the additional checks. The additional checks add a lot of noise, so it's turned into a function.

This doesn't change control flow, as the error conditions as well as if any deinit needs to be happen is different per call site.

Now whenever we need to check where headers were already sent in
ext/session, we call a single location that prints where, keeping it
consistent output wise.
Similar to the one for headers.
This usually go hand in hand with the headers already sent checks, but
is in a separate commit because of the amount of tests it changes.
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Thank you!

I'm not sure the notice when calling session_start() manually when they are automatically started should even exist. But that is a different discussion.

@NattyNarwhal NattyNarwhal merged commit 84d6cb8 into php:master Oct 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants