From c65cab710bb3d79db20862c9361d4dbbac8ac5d7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 03:20:08 +0900 Subject: feat(php-shim): model $_ENV/$_SERVER as OsString snapshots Rework the environment shim around getenv/putenv on the real environment and $_ENV/$_SERVER as startup snapshots, all over OsString. Migrate every caller off the old server()/server_argv() helpers and force the snapshots in main() before any putenv() runs. Document the porting rules in docs/dev/env-vars-porting.md. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/autoload/autoload_generator.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/autoload') diff --git a/crates/shirabe/src/autoload/autoload_generator.rs b/crates/shirabe/src/autoload/autoload_generator.rs index 7b02841..ded7cee 100644 --- a/crates/shirabe/src/autoload/autoload_generator.rs +++ b/crates/shirabe/src/autoload/autoload_generator.rs @@ -148,7 +148,12 @@ impl AutoloadGenerator { if self.run_scripts { // set COMPOSER_DEV_MODE in case not set yet so it is available in the dump-autoload event listeners - if shirabe_php_shim::server_get("COMPOSER_DEV_MODE").is_none() { + if shirabe_php_shim::PHP_SERVER + .lock() + .unwrap() + .get("COMPOSER_DEV_MODE") + .is_none() + { Platform::put_env( "COMPOSER_DEV_MODE", if self.dev_mode.unwrap_or(false) { -- cgit v1.3.1