From aa2124fe5d0c96078c034a6e4044b7e81acdf692 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 14:18:41 +0900 Subject: 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) --- docs/dev/php-rpc.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/dev/php-rpc.md') diff --git a/docs/dev/php-rpc.md b/docs/dev/php-rpc.md index f91b8e54..eb93db19 100644 --- a/docs/dev/php-rpc.md +++ b/docs/dev/php-rpc.md @@ -165,6 +165,10 @@ Notable internal helpers: - `__shirabe_settle_promise` — the inverse: drains a promise a plugin returned to Rust. React settles synchronously, so an already-settled promise yields its value here (a rejection is re-thrown as the Throw reply); one that is still pending is an explicit error. +- `__shirabe_sync_env` — replays the environment writes the Rust side made after the worker was + spawned into the storage each one names (`putenv()`, `$_ENV`, `$_SERVER`); see + [docs/dev/env-vars-porting.md](./env-vars-porting.md). The outermost `rpc_call` of a session + issues it whenever the journal has moved on. - `__shirabe_get_property` — for testing only: reads a public property of a P-table entity. - `__shirabe_oracle_roundtrip` — codec oracle support for tests. - `__shirabe_console_application_boot` — builds the worker-side `Composer\Console\Application` -- cgit v1.3.1-4-g156e