Skip to content

Conversation

@Qard
Copy link
Contributor

@Qard Qard commented Jun 11, 2025

This might only be useful in combination with the embed feature so it may make sense to gate this behind that feature, but it doesn't depend on it in any way--it can exist without it. I left the feature-gating out, but I could change that if you prefer.

Copy link
Member

@Xenira Xenira left a comment

Choose a reason for hiding this comment

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

Haven't had a detailed look yet. But looks good.

I think we can keep it without a feature guard for now.

@Xenira
Copy link
Member

Xenira commented Jun 11, 2025

Would you mind adding documentation in the /guide?

And thanks again for contributing!

@Qard
Copy link
Contributor Author

Qard commented Jun 11, 2025

Yep, I can add a guide for that. Where do you think it should go?

@Qard Qard force-pushed the ini-builder branch 6 times, most recently from c43e8b6 to 7862694 Compare June 13, 2025 08:46
@Qard Qard force-pushed the ini-builder branch 2 times, most recently from 08634cb to 6e2c008 Compare June 13, 2025 08:59
@Qard
Copy link
Contributor Author

Qard commented Jun 13, 2025

Seems the ini builder API didn't exist until 8.2. I've added compile gates to builders/mod.rs, but I'm not sure how to do the equivalent for the header include in the wrapper.h file. 🤔

@Xenira
Copy link
Member

Xenira commented Jun 13, 2025

Seems the ini builder API didn't exist until 8.2. I've added compile gates to builders/mod.rs, but I'm not sure how to do the equivalent for the header include in the wrapper.h file. 🤔

Guess you could pass that in here: https://github.com/davidcole1340/ext-php-rs/blob/cafaecc692c474281925716f256f0842e4580b28/build.rs#L177

See windows build: https://github.com/davidcole1340/ext-php-rs/blob/cafaecc692c474281925716f256f0842e4580b28/windows_build.rs#L53

@Qard Qard force-pushed the ini-builder branch 3 times, most recently from af9e073 to 9d8436f Compare June 14, 2025 15:42
@Qard
Copy link
Contributor Author

Qard commented Jun 14, 2025

I did some restructuring of the build file to include an ApiVersion enum which can be used for managing both the cfg flag names and C define names in the stacked form it was using before, so we can do EXT_PHP_RS_PHP_82 to gate C which depends on 8.2 minimum. 🙂

@Qard Qard force-pushed the ini-builder branch 9 times, most recently from 7a0495c to addaeb1 Compare June 14, 2025 16:54
@ptondereau
Copy link
Member

@Qard merged the clippy PR, you can rebase

@Qard
Copy link
Contributor Author

Qard commented Jun 27, 2025

Thanks! Rebased now. 🙂

@Qard
Copy link
Contributor Author

Qard commented Jun 28, 2025

I still seem to be getting yelled at by clippy for unrelated things. 🤔

The issues appear to be fixed by the clippy allows in #456, so maybe I'll just wait for that to land too? 😅

@Xenira
Copy link
Member

Xenira commented Jul 2, 2025

Also needs a rebase and regeneration of the allowed_bindings.rs due to conflicts.

Copy link
Member

@ptondereau ptondereau left a comment

Choose a reason for hiding this comment

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

I think we also miss the opportunity to add an integration test by supporting setting ini_entries in SapiBuilder.

in https://github.com/davidcole1340/ext-php-rs/blob/060c8bfb2dacffe35cffb558d4f3738d86a5d34c/tests/sapi.rs

We could have in addition something like this:

#[test]
fn test_sapi() {
    let mut ini = IniBuilder::new();
    ini.define("foo=bar").unwrap();
    ini.quoted("memory_limit", "128M").unwrap();

    let mut builder = SapiBuilder::new("test", "Test");
    builder = builder.ini_entries(ini.finish());
// ...    

@Qard
Copy link
Contributor Author

Qard commented Jul 3, 2025

I've updated to include all the feedback except moving the CStringScope. Just need to figure out where to put that. 😅

@Qard Qard force-pushed the ini-builder branch 4 times, most recently from d92c838 to d64d6bf Compare July 3, 2025 16:49
@Qard Qard force-pushed the ini-builder branch 4 times, most recently from c8d8838 to e9cda5e Compare July 3, 2025 17:21
Copy link
Member

@Xenira Xenira left a comment

Choose a reason for hiding this comment

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

I've updated to include all the feedback except moving the CStringScope. Just need to figure out where to put that. 😅

While I am usually against util folders I guess its better than having it in the src root, as that is getting a little full by now. Can't think of anything better right now, so I'd put int into src/util.

Can always move it later if we can think of anything better :)

Other than that this looks really good. Thank you ❤️

Copy link
Member

@ptondereau ptondereau left a comment

Choose a reason for hiding this comment

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

LGTM thank you!

@Qard Qard force-pushed the ini-builder branch 2 times, most recently from 7ac2371 to 03e84b3 Compare July 4, 2025 09:18
@Qard
Copy link
Contributor Author

Qard commented Jul 4, 2025

I moved that to src/util/cstring_scope.rs now. Anything else that needs doing, or is this good to land now? 🙂

@Xenira Xenira merged commit 14e0b61 into extphprs:master Jul 4, 2025
56 checks passed
@Qard Qard deleted the ini-builder branch July 4, 2025 10:10
@davidcole1340 davidcole1340 mentioned this pull request Jul 4, 2025
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.

4 participants