From e165b2ffa32e21c50787ae7227dc5333131d1414 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 13 Jun 2026 23:18:41 +0900 Subject: refactor(http): drop unworkable set_error_handler warning capture PHP wraps fopen/file_get_contents/file_put_contents in set_error_handler to capture warning text into error_message. Rust reports I/O failures through return values rather than warnings, so this side channel cannot work; replace the calls with TODO(phase-c) notes and leave error_message empty until the I/O layer surfaces a reason. Also remove the now-unused set_error_handler_closure shim and make set_error_handler a no-op. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-php-shim/src/lib.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'crates/shirabe-php-shim') diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 59626ea..3ec8296 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -1239,9 +1239,8 @@ pub fn include_file(file: &str) -> PhpMixed { todo!() } -pub fn set_error_handler(_callback: fn(i64, &str, &str, i64) -> bool) { - todo!() -} +// TODO(php-runtime): the callback should be registered in PHP runtime. +pub fn set_error_handler(_callback: fn(i64, &str, &str, i64) -> bool) {} pub fn debug_backtrace() -> Vec>> { todo!() @@ -1598,12 +1597,6 @@ pub fn restore_error_handler() { todo!() } -/// Closure-capturing variant of PHP `set_error_handler()`. -pub fn set_error_handler_closure(callback: Box bool>) { - let _ = callback; - todo!() -} - pub fn stream_get_contents_with_max(stream: PhpMixed, max_length: Option) -> Option { let _ = (stream, max_length); todo!() -- cgit v1.3.1