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

fix(globals): correctly fetch $_REQUEST super global #334

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Xenira
Copy link
Collaborator

@Xenira Xenira commented Oct 22, 2024

Fixes the http_request_vars(&self) method as suggested in php/php-src#16541 (comment).

Refs: #331

@Xenira Xenira force-pushed the request-global branch 2 times, most recently from b885046 to 1c0d655 Compare October 22, 2024 21:23
@Xenira Xenira marked this pull request as ready for review October 22, 2024 21:29
@Xenira Xenira requested a review from ptondereau October 22, 2024 21:29
@Xenira Xenira mentioned this pull request Nov 25, 2024
@Xenira Xenira linked an issue Nov 27, 2024 that may be closed by this pull request
@Xenira
Copy link
Collaborator Author

Xenira commented Nov 28, 2024

@joehoyle can you review this? Would like to get this merged.

Copy link
Collaborator

@joehoyle joehoyle left a comment

Choose a reason for hiding this comment

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

@Xenira there's quite a lot fo changes here whereby it's not clear that all are part of this PR. For example, all the lifetime changes ?

@@ -221,9 +221,6 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
// introduced in PHP 8.1).
//
// PHP 8.0 is the baseline - no feature flags will be introduced here.
//
// The PHP version cfg flags should also stack - if you compile on PHP 8.2 you
// should get both the `php81` and `php82` flags.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you need to change this as part of this PR? This is quite a but change as it seems maybe you're changing the fall0through beahviour of php81 being set on php82 etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I needed this to differentiate php80 and php81. Guess i could have done a and(php80, not(any(php81, php82, php83, php84))) but that seemed a little unwieldy.

But I can pull this into a separate mr.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, I'd split out. I'd rather not making that change as part of this PR unless strictly necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -2011,105 +2092,122 @@ pub struct _php_stream {
}
impl _php_stream {
#[inline]
pub fn is_persistent(&self) -> u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
pub fn is_persistent(&self) -> u16 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are all the changes to the bindings intentional? This looks like maybe you didn't compile it on the correct PHP version / system.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmm, I used php 8.3 build from source with debug enabled on a 64bit machine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm I seem to remember php in debug mode with php 8.2. I think @ptondereau mentioned somewhere to someone about how specifically this should be generated. Drives me nuts we don't have this documented yet I think :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah ok, I guess that got updated in f621e60

@Xenira
Copy link
Collaborator Author

Xenira commented Nov 28, 2024

Thanks for looking at it.

For example, all the lifetime changes ?

Those are because of new clippy rules. I could move them to a separate mr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TRACK_VARS_REQUEST seems to not be stored in http_globals
2 participants