aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-16 14:18:41 +0900
committernsfisis <nsfisis@gmail.com>2026-08-16 14:35:48 +0900
commitaa2124fe5d0c96078c034a6e4044b7e81acdf692 (patch)
treec9b1597fef555220676f6a5ae554dc81579a4269 /crates/shirabe
parentb4ab3df2ec85fbe477d7721344a8cd3630b437a1 (diff)
downloadphp-shirabe-aa2124fe5d0c96078c034a6e4044b7e81acdf692.tar.gz
php-shirabe-aa2124fe5d0c96078c034a6e4044b7e81acdf692.tar.zst
php-shirabe-aa2124fe5d0c96078c034a6e4044b7e81acdf692.zip
feat(php-rpc): replay Rust-side env writes into the PHP worker
The worker is a long-lived child holding the environment it was handed at spawn, so `@putenv`, the bin dir the event dispatcher prepends to PATH, and COMPOSER_DEV_MODE never reached the PHP code running in it. The shim now journals every write to the three storages PHP exposes, and the outermost rpc_call replays the entries the worker has not seen yet through __shirabe_sync_env. Replaying the writes rather than pushing a whole snapshot keeps the worker's own $_SERVER entries intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
-rw-r--r--crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
index 7a98adc8..e3f5c9a5 100644
--- a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
+++ b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
@@ -740,12 +740,8 @@ fn test_dispatcher_can_execute_cli_and_php_in_same_event_script_stack() {
assert_eq!(expected, io.borrow().get_output());
}
-// TODO(php-runtime): `@putenv` writes the environment of the Shirabe process, while the listener
-// reads `getenv()` inside the PHP worker — a long-lived child that keeps the environment it
-// inherited when it was spawned. Nothing propagates the write across the boundary.
#[test]
#[serial]
-#[ignore = "`@putenv ABC=123` does not reach the PHP worker the listener runs in"]
fn test_dispatcher_can_put_env() {
let _tear_down = TearDown;
if !php_runtime_available() {
@@ -786,12 +782,8 @@ fn test_dispatcher_can_put_env() {
assert_eq!(expected, io.borrow().get_output());
}
-// TODO(php-runtime): the bin dir is appended to the PATH of the Shirabe process, while the
-// listeners read `getenv('PATH')` inside the PHP worker — a long-lived child that keeps the
-// environment it inherited when it was spawned. Nothing propagates the append across the boundary.
#[test]
#[serial]
-#[ignore = "the bin dir the dispatcher appends to PATH does not reach the PHP worker the listeners run in"]
fn test_dispatcher_appends_dir_bin_on_path_for_every_listener() {
let _tear_down = TearDown;
if !php_runtime_available() {