Web: $_SERVER['SERVER_PROTOCOL'] for dev server and AOT (closes #306) - #324
Merged
Merged
Conversation
Parse the request-line HTTP version in DevServer, mirror it via putenv/CGI env, populate VM $_SERVER with a CGI default, and set sg_SERVER in the AOT refresh. Treat SERVER_PROTOCOL as a runtime $_SERVER key (with hashed LLVM C-string symbols) so AOT does not bake a compile-time value. Add PHPT and serve integration coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # docs/bootstrap-inventory.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HTTP/x.yfrom the dev-server request line, pass it throughputenv/CGI (SERVER_PROTOCOL), and populate VM$_SERVERplus AOTsg_SERVER(defaultHTTP/1.1when unset).SERVER_PROTOCOLtoRUNTIME_SERVER_KEYSso it is not compile-time baked, and name LLVM C-string globals with aphp_cstr_hash prefix so they cannot collide with libcgetenvlookups.ServeTest/ServeAotTestcoverage, and refreshdocs/bootstrap-inventory.md.Test plan
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev vendor/bin/phpunit --group serve test/real/ServeTest.php --filter ServerProtocoldocker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev vendor/bin/phpunit --group llvm,serve test/real/ServeAotTest.php --filter ServerProtocolphp script/bootstrap-inventory.php --checkandphp script/capability-matrix.php --check(inside the same image via tarball pipe; bind-mount of this workspace was empty in the harness).Closes #306.
Made with Cursor