DevEx: phpc serve --aot with runtime superglobal refresh#215
Merged
Conversation
Developers can serve a precompiled CGI binary with static docroot assets via `phpc serve --aot`, with binary resolution from phpc.json or defaults. AOT executables now call __superglobals__refresh() each run so QUERY_STRING and related env drive $_GET/$_SERVER without recompiling (issue #201). Closes #213. Implements #201. Co-authored-by: Cursor <cursoragent@cursor.com>
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
phpc serve --aotandbin/serve-aot.phpto run a precompiled AOT binary per HTTP request with CGI-style env and static docroot assets (DevEx: phpc serve --aot runs precompiled CGI binary per project #213).$_GET/$_SERVERrefresh in native binaries via__superglobals__refresh()(C runtime +main()hook) so AOT no longer requires recompiling for each query string (AOT: Per-request superglobal refresh in native binary (not compile-time bake) #201).lib/Web/DevServer.php; adds minimalphpc.jsonbinary resolution vialib/Web/ProjectManifest.php.Test plan
phpunitnon-LLVM suite (VM, compliance,ServeTest,PhpcCliTest)RuntimeSuperglobalRefreshTest,ServeAotTest(when LLVM 9 + FFI available)phpc build -o .phpc/bin/app examples/001-SimpleWeb/example.php && phpc serve --aot examples/001-SimpleWebCloses #213
Closes #201
Made with Cursor