Category
php-in-php | runtime
Problem
AOT/CGI binaries link lib/AOT/runtime/superglobals_refresh.c (~2623 lines) to repopulate $_GET, $_POST, $_SERVER, $_ENV, $_COOKIE, $_FILES, and $_REQUEST from environment variables and stdin. The same logic belongs in lib/Web/ + compiled PHP (or thin ABI calling PHP helpers), not a hand-written C parser duplicating multipart/CGI rules.
php-src reference
Repro (C runtime today)
./script/docker-exec.sh -- bash -lc 'wc -l lib/AOT/runtime/superglobals_refresh.c
grep superglobals_refresh lib/AOT/Linker.php
'
Web north-star regressions surface via existing gates when refresh semantics drift:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/Web/CgiDriverTest.php --filter multipart
'
Scope (this repo)
| Area |
Files |
| PHP implementation |
lib/Web/SuperglobalRefresh.php (or extend existing web runtime) |
| VM/CGI entry |
bin/cgi.php, lib/Web/CgiDriver.php |
| Delete |
lib/AOT/runtime/superglobals_refresh.c |
| Linker |
lib/AOT/Linker.php — drop C TU; native bridge calls PHP refresh |
| Tests |
CgiDriverTest, examples/006-FileUploadWeb multipart smoke |
Default: port behavior into PHP this repo owns; keep C as thin getenv/trampoline only if unavoidable.
Done when
Related
Category
php-in-php|runtimeProblem
AOT/CGI binaries link
lib/AOT/runtime/superglobals_refresh.c(~2623 lines) to repopulate$_GET,$_POST,$_SERVER,$_ENV,$_COOKIE,$_FILES, and$_REQUESTfrom environment variables and stdin. The same logic belongs inlib/Web/+ compiled PHP (or thin ABI calling PHP helpers), not a hand-written C parser duplicating multipart/CGI rules.php-src reference
main/php_variables.c—php_register_variable, SAPI inputmain/rfc1867.c— multipart$_FILES/$_POSTmain/SAPI.c— superglobal registrationRepro (C runtime today)
Web north-star regressions surface via existing gates when refresh semantics drift:
Scope (this repo)
lib/Web/SuperglobalRefresh.php(or extend existing web runtime)bin/cgi.php,lib/Web/CgiDriver.phplib/AOT/runtime/superglobals_refresh.clib/AOT/Linker.php— drop C TU; native bridge calls PHP refreshCgiDriverTest,examples/006-FileUploadWebmultipart smokeDefault: port behavior into PHP this repo owns; keep C as thin getenv/trampoline only if unavoidable.
Done when
superglobals_refresh.cremoved from link setruntime/$_FILESsmoke green (noPHP_COMPILER_SKIP_SERVE_TESTS)$_REQUESTmerge order matches Zend (GET+POST+COOKIE)Related
$_FILES