-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Deprecate disabling use_only_cookies #13578
Deprecate disabling use_only_cookies #13578
Conversation
1d8cbc2
to
c051248
Compare
30cff65
to
26db3b0
Compare
I don't know why the Windows tests are failing. Can someone assist? |
Add an INI section to the tests where you set error_reporting=-1, the default Windows configuration used in CI doesn't set E_DEPRECATED by default in its error_reporting. That should make them pass. |
Looks like it'll still fail because they come from startup, i.e. before it had the chance of updating the INI options. Probably the CI runner configuration should then be adjusted instead... |
Where do I change the CI configuration? |
If I had to take a guess, the error reporting is set too low in the php.ini file used for the Windows CI, but I'm not sure without digging into it where that's set. @iluuu1994 did set up the CI so he might know. |
Windows apparently only does release builds, which we should probably change. You could try changing this line:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good just some minor comments that need addressing.
This did not help. See the last commit. |
Ok, I don't know then. |
RFC for reference: https://wiki.php.net/rfc/deprecate-get-post-sessions |
@cmb69 I cc you in the hope that you how to fix the Windows failure :) |
When running
Now I wonder why that startup error is output at the end of the test on other platforms. What am I missing? @iluuu1994, |
I think I figured it out. It's because startup errors go though Lines 350 to 356 in a7bd911
Notice that the buffer is flushed on Windows but not on other platforms. But the normal test output is not sent through stderr, it is sent to stdout. So that's why we end up with different ordering: stderr is already flushed on Windows but not on other platforms so on Windows it appears before stdout and on other platforms it appears after. |
@nielsdos, good thinking, but apparently Anyway, since debugging PHPTs is harder than simple PHP files (although debugging PHPTs is supported by the php-sdk), I came up with the following simplification of ext/session/tests/bug36459.phpt:
I get the same output with I'm now going to build this PR on WSL, to be able to compare what is going on. Haven't done WSL builds for quite a while – might be fun. :) |
Right, the cgi one is here Line 757 in 0c0da80
And it doesn't explicitly flush on Windows. |
0e99d4f
to
ffade41
Compare
ffade41
to
ad35e68
Compare
ext/session/session.c
Outdated
bool *p = (bool *) ZEND_INI_GET_ADDR(); | ||
*p = zend_ini_parse_bool(new_value); | ||
if (!*p) { | ||
php_error_docref(NULL, E_DEPRECATED, "Disabling session.use_only_cookies INI setting is deprecated"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
php_error_docref(NULL, E_DEPRECATED, "Disabling session.use_only_cookies INI setting is deprecated"); | |
php_error_docref("session.configuration", E_DEPRECATED, "Disabling session.use_only_cookies INI setting is deprecated"); |
Same for the other two below. See #15505.
Is what I did in ad35e68 what you had in mind but for all tests in this PR? |
Right; well, for all tests which requires it (likely all rfc1867_*.phpts). |
I don't think I can do that with |
Ah, interesting. I'll have a closer look at this one soon. |
That test uses output buffering and manual session start to work around the startup error issue. But for this test, I don't see any good reason why we would need |
c32805d
to
5ba6f11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the two nits, this looks good to me. Thanks for your patience! :)
But let's wait what others have to say (still almost a week till PHP 8.4.0beta4).
Co-authored-by: Christoph M. Becker <[email protected]>
Note that the respective RFC has been accepted unanimously (29:0 votes); it would be a shame if it wouldn't make it into PHP 8.4. |
@NattyNarwhal Can we merge it as is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to merge to me
This RFC[1] has already been implemented via its respective PR[2], so we add this information to UPGRADING. [1] <https://wiki.php.net/rfc/deprecate-get-post-sessions> [2] <php#13578>
This RFC[1] has already been implemented via its respective PR[2], so we add this information to UPGRADING. [1] <https://wiki.php.net/rfc/deprecate-get-post-sessions> [2] <php#13578>
This RFC[1] has already been implemented via its respective PR[2], so we add this information to UPGRADING. [1] <https://wiki.php.net/rfc/deprecate-get-post-sessions> [2] <#13578>
No description provided.