From f87b930a5bf21d2f60a53151599e0953b7c1f99e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 05:11:32 +0900 Subject: feat(php-shim): drop shutdown function shim, defer OOM message to PHP Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-php-shim/src/runtime.rs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'crates/shirabe-php-shim') diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs index e002138..88ab7ae 100644 --- a/crates/shirabe-php-shim/src/runtime.rs +++ b/crates/shirabe-php-shim/src/runtime.rs @@ -529,24 +529,6 @@ pub fn ini_set(_varname: &str, _value: &str) -> Option { todo!() } -thread_local! { - static SHUTDOWN_FUNCTIONS: std::cell::RefCell>> = - const { std::cell::RefCell::new(Vec::new()) }; -} - -pub fn register_shutdown_function(callback: Box) { - SHUTDOWN_FUNCTIONS.with(|f| f.borrow_mut().push(callback)); -} - -// Runs the registered shutdown functions in registration order, mirroring PHP -// executing them at the end of the request. Must be invoked at every process exit. -pub fn run_shutdown_functions() { - let functions = SHUTDOWN_FUNCTIONS.with(|f| std::mem::take(&mut *f.borrow_mut())); - for callback in &functions { - callback(); - } -} - pub fn composer_dev_warning_time() -> i64 { // TODO(phase-d): COMPOSER_DEV_WARNING_TIME is a build-time constant baked into Composer's release // artifact; it has no fixed value in source and must be provided by the build process. @@ -590,8 +572,6 @@ pub fn phpinfo(_what: i64) { } pub fn exit(status: i64) -> ! { - // PHP runs registered shutdown functions before terminating. - run_shutdown_functions(); std::process::exit(status as i32); } -- cgit v1.3.1