Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ext-php-rs refactor#3

Merged
Qard merged 22 commits into
mainplatformatic/php-node:mainfrom
ext-php-rs-refactorplatformatic/php-node:ext-php-rs-refactorCopy head branch name to clipboard
May 8, 2025
Merged

ext-php-rs refactor#3
Qard merged 22 commits into
mainplatformatic/php-node:mainfrom
ext-php-rs-refactorplatformatic/php-node:ext-php-rs-refactorCopy head branch name to clipboard

Conversation

@Qard

@Qard Qard commented Mar 26, 2025

Copy link
Copy Markdown
Member

This is a refactor of #2 to instead use ext-php-rs as it is a lot easier to get it to build correctly and gives us more flexibility to support dynamic loaded extensions.

@Qard Qard added the enhancement New feature or request label Mar 26, 2025
@Qard Qard force-pushed the ext-php-rs-refactor branch 2 times, most recently from 6b72a19 to 09f540c Compare March 26, 2025 16:20
Comment thread crates/lang_handler/src/ffi.rs Outdated
Comment thread crates/lang_handler/src/ffi.rs Outdated
Comment thread crates/lang_handler/src/ffi.rs Outdated
Comment thread crates/lang_handler/src/ffi.rs
Comment thread crates/lang_handler/src/headers.rs Outdated
{
match self.0.get(key.as_ref()) {
Some(Header::Single(value)) => Some(value.clone()),
Some(Header::Multiple(values)) => values.last().cloned(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not sure it is correct, I'm sure for some headers, for example Cache-control in response, they should be listed comma separated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, at the moment this is leaving that up to the user. They can do get to get the last header, assuming only one matters. They can do get_all when they want an array of values, useful when needing to treat them as separate lines like with Cookies, and they can use get_line to get the headers joined into one comma-separated string, which is what the spec says is the only valid way to have multiple values in one string, but with the exception that any headers which already contain a comma (such as Cookies) may need special parsing and so are generally not recommended to use in that way as servers may not parse the header line correctly.

I opted for manual control here rather than encoding all the rules directly into the Headers type, which would be complicated and add maintenance burden to keep it updated, plus would not include any understanding of custom/non-standard headers. Just seemed like a better choice to leave it up to the user and suggest a default in the doc comments.

Comment thread crates/php/src/embed.rs Outdated
@simone-sanfratello

Copy link
Copy Markdown

I left some comments, but maybe at this stage are not important, feel free to ignore them

A-M-A-Z-I-N-G

@mcollina mcollina 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.

Wow!

@mcollina

Copy link
Copy Markdown
Member

once CI is passing :)

@Qard Qard force-pushed the ext-php-rs-refactor branch 3 times, most recently from cc058e5 to 7cad525 Compare April 11, 2025 14:06
@Qard Qard force-pushed the ext-php-rs-refactor branch 11 times, most recently from 641d0a4 to e7353ea Compare April 21, 2025 11:49
@Qard Qard force-pushed the ext-php-rs-refactor branch 8 times, most recently from 3306bf5 to 9b883a5 Compare May 1, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.