aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/main.rs')
-rw-r--r--crates/shirabe/src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/shirabe/src/main.rs b/crates/shirabe/src/main.rs
index 3e3623d..538d89d 100644
--- a/crates/shirabe/src/main.rs
+++ b/crates/shirabe/src/main.rs
@@ -1,8 +1,13 @@
//! ref: composer/bin/composer
-use shirabe_php_shim::run_shutdown_functions;
+use shirabe_php_shim::{PHP_ENV, PHP_SERVER, run_shutdown_functions};
fn main() {
+ // Take the $_ENV / $_SERVER snapshots before any putenv() mutates the real environment.
+ // See `docs/dev/env-vars-porting.md` for details.
+ std::sync::LazyLock::force(&PHP_ENV);
+ std::sync::LazyLock::force(&PHP_SERVER);
+
let result = shirabe::run(std::env::args().collect());
run_shutdown_functions();
let mut exit_code = match result {