diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 05:11:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 05:11:51 +0900 |
| commit | f87b930a5bf21d2f60a53151599e0953b7c1f99e (patch) | |
| tree | 617b5e94d7d4384727da6826c632d8695e9facb7 /crates/shirabe-php-shim/src | |
| parent | 6d53dd16759df8b2cde09047ddcf460652034fd9 (diff) | |
| download | php-shirabe-f87b930a5bf21d2f60a53151599e0953b7c1f99e.tar.gz php-shirabe-f87b930a5bf21d2f60a53151599e0953b7c1f99e.tar.zst php-shirabe-f87b930a5bf21d2f60a53151599e0953b7c1f99e.zip | |
feat(php-shim): drop shutdown function shim, defer OOM message to PHP
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src')
| -rw-r--r-- | crates/shirabe-php-shim/src/runtime.rs | 20 |
1 files changed, 0 insertions, 20 deletions
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<String> { todo!() } -thread_local! { - static SHUTDOWN_FUNCTIONS: std::cell::RefCell<Vec<Box<dyn Fn()>>> = - const { std::cell::RefCell::new(Vec::new()) }; -} - -pub fn register_shutdown_function(callback: Box<dyn Fn()>) { - 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); } |
